View Full Version : can't get gotoAndPlay to work
hipster
06-25-2002, 09:02 PM
I know this sounds easy...but it's just not working!
So I have my main movie Master.swf with an empty movie clip called container1 that I'm loading a swf into called top.swf.
top.swf has 3 scenes...intro, main and outro.
I want a button in Master.swf to tell whatever is in the container1 to gotoAndPlay the outro scene.
HOOOOW? This thing hates me!
thanks,
morgan
anjelika
06-25-2002, 10:55 PM
what I understood is that you want to load a movie inti a major movie and when you click on the button on major (Master.swf) the top.swf should go to the outro scene
What I usually do is, I load a movie into a level (like level1)instead of a MC, and then on the button you can put this script
on(press) {
_level1.gotoAndPlay("Outro", 1)
}
maybe this will work
Abelius
06-25-2002, 11:57 PM
It would also work by setting a value to some variable. Then the movie that has just been loaded (onLoad) would check the value of the variable, and do specific stuff depending on its value... :)
WeirdAssChris
06-26-2002, 04:00 PM
Because main.swf and top.swf are 2 separate .swf movies you have to pass variables around with the post or get methode.
There is a tutorial on this subject in the tutorial section.
http://www.actionscripts.org/tutorials/intermediate/passing_variables_around/index.shtml
pinkaboo
06-26-2002, 04:15 PM
on(press, release) {
_root.container1.gotoAndPlay("framelabel");
}
A> First of all the external swf has to fully loaded before you send the command else it won't work, I'm assuming that because it is an outro scene that you wish to play that the swf is obviously loaded because you would have wanted it to play the intro and content scenes first right?
B> When top.swf loads into container1, to all intents and purposes it becomes container1.
C> Scenes are icky. Avoid scenes if at all possible, they like to mess with your head. Scenes are supposed to make it easier for the designer/developer to organise movies, however, when Flash exports it ignores scenes and creates one long timeline. So if your first scene is 20 frames long and you reference a frame as scene2 frame 80, in actual fact that will be frame 100. All a bit messy.
Anyhow, You already have scenes in your movie so rather than mess with your layout so I would advise that you label the first frame of each scene with a unique tag and reference the scenes that way instead. So, where I wrote "framelabel" above, insert the name of the first frame in your Outro scene.
and (fingers crossed) hey presto, that SHOULD solve your problem
:)
pinK
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.