MovieClip
863
var bounds_obj:Object = square_mc.getBounds(this);
for (var i in bounds_obj) {
trace(i+" --> "+bounds_obj[i]);
}
The following information appears in the Output panel:
yMax --> 110
yMin --> 10
xMax --> 110
xMin --> 10
See also
getRect (MovieClip.getRect method)
,
globalToLocal (MovieClip.globalToLocal
method)
,
localToGlobal (MovieClip.localToGlobal method)
getBytesLoaded (MovieClip.getBytesLoaded
method)
public getBytesLoaded() : Number
Returns the number of bytes that have already loaded (streamed) for the movie clip. You can
compare this value with the value returned by
MovieClip.getBytesTotal()
to determine
what percentage of a movie clip has loaded.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability:
ActionScript 1.0; Flash Player 5
Returns
Number
- An integer that indicates the number of bytes loaded.
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;
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...