Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-04-2003, 07:16 AM   #1
GBTampa
Registered User
 
Join Date: Oct 2003
Location: Tampa
Posts: 1
Default Load Movie and go to specific frame or scene

Greetings everyone.

I'm primarily a Director user, but have just begun Flashing. I have encountered a problem that should be very simple to solve, but has turned into a really big deal.

All I want to do is load a movie/swf file (from a running movie/swf file), and go to a specific frame or scene in the loaded movie. What is happening is, I can call the movie, but not specify the frame or scene.

In a nutshell: From the "Main level"/"Level-0" movie, at an arbitrary point in the timeline, while the movie is playing, I click on a button and stop the timeline from playing.

I then click on a newly visible picture/button, which links me to the sub-level swf/movie.

The sub-level movie has only a stop command and a "back button" (at this point).

I want to be able to click on the "back-button" and return to the exact point in the time line in the Main-level movie that I left from.

This is a cinch if we are dealing with different scenes in the same movie, but we're not.

Go to: http://www.showorksevents.com/Us/ProfAff/New/new.htm

Scroll the picture timeline. Click on a picture. It takes you to a "sub-level" movie. Click the back button. You return to frame 1, Scene 1, of the "main-level"/"Level 0" movie. I want to return to frame 18 of Scene 1 of the main level movie.

I have tried and tried, read everything I can find, seached the net, and am now asking the real guys. Any ideas how a not very good with ActionScripts kinda guy can make this happen?

Any help would be greatly appreciated.
Thanks

GB
GBTampa is offline   Reply With Quote
Old 10-04-2003, 07:39 AM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy and Welcome...

Hm... Director user, eh??? I sincerely advise you go back to Director... I used to the Director before I migrated to Flash and after several years later, I do not remember what Director is anymore...
Quote:
I want to return to frame 18 of Scene 1 of the main level movie.
Well... I do not know what syntax you are using but make sure that you are specifying which timeline you want to move... And, utilize the frame label instead of the frame number... Avoid using the 'scene' as much as you can...

So, the simplest way of solving it would be creating a frame label on the frame 18 of the Scene 1, name it "someMarker", and use gotoAndPlay() or gotoAndStop() function to go back to that place like this...
ActionScript Code:
_root.gotoAndPlay("someMarker");
Hope this solves your problem...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-09-2007, 06:56 PM   #3
lavanya.aa
Registered User
 
Join Date: Feb 2007
Posts: 1
Default similar doubt

hi

I am new here. I need to understand urgently "how to load a movie and go to a specific button of the loaded movie".

I have been using flash MX 2004, but relatively new to it.
If i have two movies abc.swf and xyz.swf, and i need to load xyz.swf from a button in abc.swf, then the script i use is

on (release) {
loadMovie ("xyz.swf",0)
}

this script works perfectly but takes me to frame 1 of xyz.swf only.
MY REQUIREMENT IS TO REACH SAY "FRAME 5 OF xyz.swf."
can some one help immediately??

what should be the script in that case?

can email me on [email protected] as well
thanks a ton
lavanya.aa is offline   Reply With Quote
Old 02-20-2007, 11:57 AM   #4
Trupti
Registered User
 
Join Date: Sep 2006
Posts: 35
Default

Hi lavanya.aa

what u can do is define one global variable with some value in ur first file (i.e. abc.fla in this case). Check for the value of this variable in ur second file (i.e. xyz.fla in this case) at first frame and move to the frame u require as per the condition.

Here I have attached the sample for u.

Hope it will help u.

feel free to ask for any other query!!


Regards,

Trupti
Attached Files
File Type: zip loadmoviesample.zip (14.1 KB, 2861 views)
Trupti is offline   Reply With Quote
Old 06-20-2007, 04:19 PM   #5
kirupa's cousin
Registered User
 
Join Date: Jun 2007
Posts: 1
Exclamation Same doubt

Quote:
Originally Posted by Trupti View Post
Hi lavanya.aa

what u can do is define one global variable with some value in ur first file (i.e. abc.fla in this case). Check for the value of this variable in ur second file (i.e. xyz.fla in this case) at first frame and move to the frame u require as per the condition.

Here I have attached the sample for u.

Hope it will help u.

feel free to ask for any other query!!


Regards,

Trupti

Hi Trupti,

I have the same doubt with lavanya, so i download your example..
it was working but never show any script on it...
how you did that? can you tell me more on that?
by the way, i'm using Flash 8...


thanks a lot
p/s : need help urgently

Last edited by kirupa's cousin; 06-20-2007 at 04:27 PM.
kirupa's cousin is offline   Reply With Quote
Old 06-21-2007, 04:51 AM   #6
Trupti
Registered User
 
Join Date: Sep 2006
Posts: 35
Default

Hi, there,


Here is the script code for each file.



First abc.fla:
Quote:
script on layer 1 - button

on(press)
{
_global.xx = 1;
trace(xx);
loadMovie("xyz.swf", 0);
}
Second xyz.fla:


Quote:
script on layer 1 inside movie clip
frame 1- here you will be cheking for the value of the global variable xx.

stop();
trace(xx);
if(xx == 1)
{
gotoAndPlay(5);
}


frame 6 and 15
stop();

I hope this is what u want.
Feel free to clear any other doubt.


Regards,

Trupti.
Trupti is offline   Reply With Quote
Old 06-23-2007, 03:13 PM   #7
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Default

After I read this thread last night, I thought of doing an example. So I got stuck. I did this before, now I don't see the problem in my code, I just can't see it.
What I wanna do, is basically the same as in this thread, in first.swf load second.swf intro movieclip 'holder' and jump to frame 10 in second.swf.
This is what I did:

In first.fla I have on the first frame:

Code:
_root.holder.createEmptyMovieClip("hold", 0);
_root.holder.hold.loadMovie("second.swf");
trace(_root.holder.hold);
this.onEnterFrame = function() {
	if (_root.holder.hold._framesloaded >= _root.holder.hold._totalframes) {
		trace("loaded");
		_root.holder.hold.gotoAndStop("ten");
		delete this.onEnterFrame;
	}
};
stop();
I've added the onEnterFrame after a few tries when nothing happened and I thought the movie is not loaded yet.

In the second file I have a stop(); action on first frame, wrote 'frame 1' in 1 frame, 'frame 10' in frame 10, 'frame 20' in frame 20 and named the tenth frame 'ten'.

My problem is that it does not jump to frame 10, but get's stuck on first frame in second.swf.
I've looked into some of my past projects and I am doing almost the same thing... I cannot understand what's going on.

Thanks.
AngelEyesShadow is offline   Reply With Quote
Old 06-23-2007, 03:46 PM   #8
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Default

If I add a variable in first.swf, on the first frame, let's say: ex = 100; and i try to trace it in the second movie clip that I load like this: trace(_root.ex); it show 100 (I do not use _lockroot).

So I can see variables that exist in the first movie from the movie loaded but I cannot move inside the loaded movie nor I do see variables inside it. I am weird
AngelEyesShadow is offline   Reply With Quote
Old 06-23-2007, 04:28 PM   #9
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

This works...

ActionScript Code:
_root.holder.createEmptyMovieClip("hold", 0); _root.holder.hold.loadMovie("second.swf"); trace(_root.holder.hold); this.onEnterFrame = function() {     if (_root.holder.hold.getBytesLoaded() >= _root.holder.hold.getBytesTotal() && _root.holder.hold.getBytesLoaded() > 10) {         trace("loaded");         _root.holder.hold.gotoAndStop("ten");         delete this.onEnterFrame;     } }; stop();
atomic is offline   Reply With Quote
Old 06-24-2007, 10:08 AM   #10
AngelEyesShadow
ReFlasH...
 
AngelEyesShadow's Avatar
 
Join Date: Oct 2003
Location: Cyprus
Posts: 222
Default

Thanks, I was thinking that the movie is not loaded yet but I thought it should work with frames loaded. It's seems it didn't, thanks.
AngelEyesShadow is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:46 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.