Posted By

adrianparr on 08/04/10


Tagged

global local x position as3 y localtoglobal


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

Nikolai
thastyle
ithnkme
tspitzr
mitien


AS3 LocalToGlobal Example


 / Published in: ActionScript 3
 

URL: http://www.orlandmedia.com/blog/actionscript-3/localtoglobal-in-as3-not-working/

This demonstrates how to use localToGlobal in AS3.

  1. var targetMc:MovieClip;
  2. targetMc = purple.yellow.blue.green.red;
  3. var pt:Point = new Point(targetMc.x, targetMc.y);
  4. pt = targetMc.parent.localToGlobal(pt);
  5.  
  6. trace("red global x: "+ pt.x);
  7. trace("red global y: "+ pt.y);

Report this snippet  

You need to login to post a comment.