GlobalToLocal / LocalToGlobal? Meet – localToLocal!

Author: seven November 14, 2006

John Grden came up with great idea to deal with coordinate conversion in Flash – localToLocal! He first implemented it way back in Flash6.

class com.rockonflash.utils.CoordinateTools
public static function localToLocal(from:MovieClip, to:MovieClip, origin:Object):Object
var point:Object = origin == undefined ? {x: 0, y: 0} : origin;
return point;

Just use it to create your point object and you’re done:

var point:Object = CoordinateTools.localToLocal(from:MovieClip, to:MovieClip);

CEO/CTO at Nivas®
Neven Jacmenović has been passionately involved with computers since late 80s, the age of Atari and Commodore Amiga. As one of internet industry pioneers in Croatia, since 90s, he has been involved in making of many award winning, innovative and successful online projects. He is an experienced full stack web developer, analyst and system engineer. In his spare time, Neven is transforming retro-futuristic passion into various golang, Adobe Flash and JavaScript/WebGL projects.

    Leave a Reply

    Your email address will not be published. Required fields are marked *