Gotoandstop() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

gotoAndStop()

Availability
Flash 2.
Usage
gotoAndStop([scene:String,] frame:Object) : Void
Parameters
An optional string specifying the name of the scene to which the playhead is sent.
scene
A number representing the frame number, or a string representing the label of the frame,
frame
to which the playhead is sent.
Returns
Nothing.
Description
Function; sends the playhead to the specified frame in a scene and stops it. If no scene is specified,
the playhead is sent to the frame in the current scene.
You can use the
scene
or other objects in the document.
Example
In the following example, a document has two scenes:
contains a frame label on Frame 10 called
myOtherBtn_btn
stop();
myBtn_btn.onRelease = function(){
gotoAndStop("newFrame");
};
myOtherBtn_btn.onRelease = function(){
gotoAndStop("sceneTwo", 1);
};
When the user clicks the buttons, the playhead moves to the specified location and stops.
See also
MovieClip.gotoAndStop(), stop(), play(),
324
Chapter 2: ActionScript Language Reference
parameter only on the root Timeline, not within Timelines for movie clips
. This ActionScript is placed on Frame 1, Scene 1 of the main Timeline:
ActionScript Language Reference
sceneOne
, and two buttons,
newFrame
gotoAndPlay()
CHAPTER 2
and
. Scene one
sceneTwo
and
myBtn_btn

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents