User Guide

MovieClip 467
Example
The following example creates a movie clip called
square_mc. The code draws a square for
that movie clip and uses
MovieClip.getBounds() to display the coordinate values of the
instance in the Output panel.
this.createEmptyMovieClip("square_mc", 1);
square_mc._x = 10;
square_mc._y = 10;
square_mc.beginFill(0xFF0000);
square_mc.moveTo(0, 0);
square_mc.lineTo(100, 0);
square_mc.lineTo(100, 100);
square_mc.lineTo(0, 100);
square_mc.lineTo(0, 0);
square_mc.endFill();
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
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 Lite 2.0
Returns
Number - An integer indicating the number of bytes loaded.