
MovieClip.getBounds() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
657
See Also
MovieClip.getBytesLoaded(), MovieClip.onData(), MovieClip._totalframes; “The Band-
width Profiler,” in the online technote http://www.moock.org/asdg/technotes
MovieClip.getBounds() Method
determine the bounding box of a clip or movie
Flash 5
mc.getBounds(targetCoordinateSpace)
Arguments
targetCoordinateSpace
A string indicating the path to the movie or clip in whose coordinate space
mc’s dimensions are measured. Because a movie clip reference is converted to a
path when used in a string context,
targetCoordinateSpace can also be a movie
clip object reference, as in
mc.getBounds(_root) versus mc.getBounds("_root").
Defaults to
mc if not specified.
Returns
An object whose properties—xMin, xMax, yMin, and yMax—describe the bounding box of the
space occupied by
mc. These four properties of the object specify the leftmost, rightmost,
topmost, and bottommost pixel coordinates of
mc.
Description
The getBounds() method returns an anonymous object with properties that define the rect-
angular area occupied by
mc (i.e., mc’s bounding box). To retrieve the values stored in the
returned object, we must access that object’s properties, as shown in the following
Example.
The dimensions of the bounding box of a clip can be measured relative ...