Posted By

arpo on 01/27/09


Tagged


Versions (?)

Who likes this?

7 people have marked this snippet as a favorite

psychoinca
damarev
billyWhite
iamgowan
elkraneo
Gamebytes
mecsekikrisztian


Local To Global


 / Published in: ActionScript 3
 

  1. import flash.geom.Point;
  2.  
  3. var xGlob:Number = this.parent.localToGlobal(new Point(this.x, 0)).x;
  4. var yGlob:Number = this.parent.localToGlobal(new Point(0, this.y)).y;
  5.  
  6. trace(yGlob);
  7. trace(xGlob);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: billyWhite on July 21, 2009

There is an error in the above code, should be:

var yGlob = this.parent.localToGlobal(new Point(0, this.y)).y;

Posted By: arpo on August 26, 2009

Thanx! I'll fix

Posted By: Swil on January 3, 2010

Thanks, this worked perfectly!

You need to login to post a comment.