Flash Player 5.
my_mc.localToGlobal(point:Object): Void
point The name or identifier of an object created with the Object class, specifying the x and y coordinates as properties.
Nothing.
Method; converts the point object from the movie clip's (local) coordinates to the Stage (global) coordinates.
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
The following example converts x and y coordinates of the my_mc object, from the movie clip's (local) coordinates to the Stage (global) coordinates. The center point of the movie clip is reflected after you click and drag the instance.
this.createTextField("point_txt", this.getNextHighestDepth(), 0, 0, 100, 22);var mouseListener:Object = new Object();mouseListener.onMouseMove = function() {var point:Object = {x:my_mc._width/2, y:my_mc._height/2};my_mc.localToGlobal(point);point_txt.text = "x:"+point.x+", y:"+point.y;};Mouse.addListener(mouseListener);my_mc.onPress = function() {this.startDrag();};my_mc.onRelease = function() {this.stopDrag();};}
MovieClip.globalToLocal()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001521.html
Comments
MotionMaker said on Sep 22, 2004 at 12:43 PM : Chrominance said on Nov 24, 2004 at 7:45 AM : mab123 said on Apr 27, 2005 at 10:53 AM :