EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 501

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 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...
MovieClip.getBounds() 501
Example
The following example uses the _framesloaded property to start a SWF file when all the frames
are loaded. If all the frames arent loaded, the
_xscale property of the movie clip instance loader
is increased proportionally to create a progress bar.
if (_framesloaded >= _totalframes) {
gotoAndPlay ("Scene 1", "start");
} else {
_root.loader._xscale = (_framesloaded/_totalframes)*100;
}
See also
MovieClipLoader class
MovieClip.getBounds()
Availability
Flash Player 5.
Usage
my_mc.getBounds(targetCoordinateSpace)
Parameters
targetCoordinateSpace
The target path of the Timeline whose coordinate system you want
to use as a reference point.
Returns
An object with the properties xMin, xMax, yMin, and yMax.
Description
Method; returns properties that are the minimum and maximum x and y coordinate values of the
instance specified by
my_mc for the targetCoordinateSpace parameter.
Note: Use MovieClip.localToGlobal() and MovieClip.globalToLocal() to convert the movie clip’s
local coordinates to Stage coordinates, or Stage coordinates to local coordinates, respectively.
Example
In the following example, the object that getBounds() returns is assigned to the identifier
clipBounds. You can then access the values of each property and use them in a script. In this
script, another movie clip instance,
clip2, is placed alongside clip.
clipBounds = clip.getBounds(_root);
clip2._x = clipBounds.xMax;
See also
MovieClip.globalToLocal()
, MovieClip.localToGlobal()

Table of Contents

Related product manuals