Posted By

weavermedia on 11/23/10


Tagged

as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

weavermedia
tspitzr
prjohnny


AS3 Get global coordinates of a nested MovieClip


 / Published in: ActionScript 3
 

  1. // parent object = 'holder'
  2. // child object = 'mc'
  3. // trace (1) - coords of child relative to 0,0 of the parent ('holder')
  4. // trace (2) - coords of child relative to 0,0 of main stage
  5.  
  6. trace("Local Kid coords : " + (new Point(holder.mc.x, holder.mc.y)));
  7. trace("Global Kid coords : " + holder.localToGlobal(new Point(holder.mc.x, holder.mc.y)));

Report this snippet  

You need to login to post a comment.