Getdepth (Movieclip.getdepth Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Enter the following ActionScript in Frame 1 of the Timeline:
var pctLoaded:Number = Math.round(this.getBytesLoaded()/
this.getBytesTotal()*100);
bar_mc._xscale = pctLoaded;
Add the following code to 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 to Frame 3:
stop();
See also
getBytesLoaded (MovieClip.getBytesLoaded method)

getDepth (MovieClip.getDepth method)

public getDepth() : Number
Returns the depth of the movie clip instance.
Each movie clip, button, and text field has a unique depth associated with it that determines
how the object appears in front of or in back of other objects. Objects with higher depths
appear in front.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
- The depth of the movie clip.
Number
Example
The following code traces the depth of all movie clip instances on the Stage:
for (var i in this) {
if (typeof (this[i]) == "movieclip") {
trace("movie clip '"+this[i]._name+"' is at depth "+this[i].getDepth());
}
}
MovieClip
469

Advertisement

Table of Contents
loading

Table of Contents