Flash 2.
gotoAndPlay([scene:String,]frame:Object): Void
scene An optional string specifying the name of the scene to which the playhead is sent.
frame A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent.
Nothing.
Function; sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.
You can use the scene parameter only on the root Timeline, not within Timelines for movie clips or other objects in the document.
In the following example, a document has two scenes: sceneOne and sceneTwo. Scene one contains a frame label on Frame 10 called newFrame and two buttons, myBtn_btn and myOtherBtn_btn. This ActionScript is placed on Frame 1, Scene 1 of the main Timeline.
stop();
myBtn_btn.onRelease = function(){
gotoAndPlay("newFrame");
};
myOtherBtn_btn.onRelease = function(){
gotoAndPlay("sceneTwo", 1);
};
When the user clicks the buttons, the playhead moves to the specified location and continues playing.
MovieClip.gotoAndPlay(),play(),nextFrame(),prevFrame()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001363.html
Comments
helentriolo said on Oct 26, 2004 at 9:01 AM : No screen name said on Nov 18, 2004 at 2:04 PM : Emotinator said on Jan 11, 2005 at 2:10 PM : No screen name said on Jan 18, 2005 at 11:38 PM : orbi2004 said on May 23, 2005 at 2:07 PM :