AS3 LocalToGlobal Example


/ Published in: ActionScript 3
Save to your folder(s)

This demonstrates how to use localToGlobal in AS3.


Copy this code and paste it in your HTML
  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);

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.