
MovieClip.moveTo() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
673
mainX = myPoint.x;
mainY = myPoint.y;
Example
The following example determines the location of a clip’s registration point, relative to the
main Stage:
pt = new Object(); // Create generic object to hold our point
pt.x = 0; // Horizontal registration point of clip
pt.y = 0; // Vertical registration point of clip
this.localToGlobal(pt); // Convert pt to main Stage coordinates
trace("On the main Stage, the registration point of the current clip is at: ");
trace("x: " + pt.x + "y: " + pt.y);
The localToGlobal() method can be used to convert a point to Stage coordinates for use
with the hitTest() method, which expects points to be supplied in the Stage’s coordinate
space. It can also be used to compare points in two different movie clips using a common
coordinate space.
See Also
MovieClip.globalToLocal(), MovieClip.hitTest()
MovieClip.moveTo() Method
moves the drawing pen to a new position without drawing a line
Flash 6
mc.moveTo(x, y)
Arguments
x The new horizontal position of the pen, as a floating-point number.
Measured relative to
mc’s registration point.
y The new vertical position of the pen, as a floating-point number. Measured
relative to
mc’s registration point.
Description
Conceptually, lines and curves are drawn in Flash by a theoretical ...