gotoAndPlay() and gotoAndStop() are two function that help to control the playhead in flash movieclip. gotoAndPlay() cause the playhead to jump to the specified scene and frame and continue playing , where as gotoAndStop() causes the playhead to jump to the destination and stops from progressing further.
In AS 2.0 the order of scene and frame parameters to the functions are reversed. If only one parameter is passed, this value will be considered as the frame number or label. The play head will be moved to that frame in the present scene.
Usage
gotoAndPlay(frame:Object, scene:String = null):void
gotoAndStop(frame:Object, scene:String = null):void
Parameters
scene The scene name to which the playhead is sent. eg: “GameScene”
frame The frame number or label to which the playhead is sent. eg: 10 , “LoadFrame”
Eg:
mc1.gotoAndPlay(mc1.currentFrame + 10);//goes to frame number (mc1.currentFrame + 10
)
mc1.gotoAndPlay("Load", "Scene_Score");// Frame='Load', Scene='Scene_Score
'
gotoAndPlay("end"); // goes to frame labeled 'end' in the current scene
hai, i was wondering how the script to go to new scene and stop the sound from previous scene?
for example my menu scene it has a background sound. When i click to go to new scene which is the content scene, it still play the background sound from the menu….
I know this post is kinda old. But I am looking for a script were I can play frames 2 to 25. For example play a sequence of frames off a timeline inside of a MovieClip.
Or I could load each sequence in an MC, then switch them out the MocieClips.
Thanks in advance.
Garrett
SE USA ASI EN AS3.0
gotoAndPlay(“Info”, 1); AS2
gotoAndPlay(1,”Info”); AS3
Es todo lo que cambia!
Hello,
I got an error message when I tried to used the following code:
gotoAndPlay(frame:1, scene:”logo_mc”);
Do I use the movie clip anme or the layer name for the scene value?
any assistance will be highly appreciated.
thanks