EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Gotoandstop (Movieclip.gotoandstop Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MovieClip 877
See also
gotoAndPlay function, play function
gotoAndStop (MovieClip.gotoAndStop method)
public gotoAndStop(frame:Object) : Void
Brings the playhead to the specified frame of the movie clip and stops it there. To specify a
scene in addition to a frame, use the
gotoAndStop() method.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 5
Parameters
frame:Object - The frame number to which the playhead is sent.
Example
The following example uses the
_framesloaded property to start a SWF file when all the
frames are loaded. If all the frames aren't loaded, the
_xscale property of the loader movie
clip instance is increased proportionally to create a progress bar.
Enter the following ActionScript on Frame 1 of the Timeline:
var pctLoaded:Number = Math.round(this.getBytesLoaded()/
this.getBytesTotal()*100);
bar_mc._xscale = pctLoaded;
Add the following code on Frame 2:
if (this._framesloaded<this._totalframes) {
this.gotoAndPlay(1);
} else {
this.gotoAndStop(3);
}
Place your content on or after Frame 3. Then add the following code on Frame 3:
stop();
See also
gotoAndStop function, stop function

Table of Contents

Related product manuals