EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Getbytestotal (Movieclip.getbytestotal Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 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...
468 ActionScript classes
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 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, and then add the following code to Frame 3:
stop();
See also
getBytesTotal (MovieClip.getBytesTotal method)
getBytesTotal (MovieClip.getBytesTotal method)
public getBytesTotal() : Number
Returns the size, in bytes, of the movie clip. 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
uncompressed size of the SWF file.
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 - An integer indicating the total size, in bytes, of the movie clip.
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 movie clip
instance
loader is increased proportionally to create a progress bar.

Table of Contents

Related product manuals