MovieClip
469
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
Number
- The depth of the movie clip.
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());
}
}
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...