View Single Post
Codemonkey's Avatar Codemonkey Codemonkey is offline Super Moderator 2006-11-05 #9 Old  
008 - Converting coordinates
 
To quickly convert a coordination in one movieclip to another movieclip, you can use the following function:

ActionScript Code:
  1. import flash.geom.Point;
  2.  
  3. function transCoord(coord:Point, from:MovieClip, to:MovieClip):Void {
  4.         from.localToGlobal(coord);
  5.         to.globalToLocal(coord);
  6.     }
This can come in handy for example when you need to move a movieclip to another movieclip that is not in the same container mc.