Flash Player 5.
my_mc.getBytesTotal(): Number
None.
An integer indicating the total size, in bytes, of my_mc.
Method; returns the size, in bytes, of the movie clip specified by my_mc. For movie clips that are external (the root SWF file or a movie clip that is being loaded into a target or a level), the return value is the size of the SWF file.
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
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 movie clip instance loader is increased proportionally to create a progress bar.
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();
MovieClip.getBytesLoaded()
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/00001504.html
Comments
Sardok said on Dec 9, 2004 at 2:19 AM : Venkman said on Mar 8, 2005 at 9:55 PM : mspres said on Mar 10, 2005 at 8:24 PM :