{"id":83,"date":"2006-11-14T00:09:50","date_gmt":"2006-11-13T22:09:50","guid":{"rendered":"http:\/\/www.nivas.hr\/blog\/2006\/11\/14\/globaltolocal-localtoglobal-meet-localtolocal\/"},"modified":"2006-11-14T00:13:02","modified_gmt":"2006-11-13T22:13:02","slug":"globaltolocal-localtoglobal-meet-localtolocal","status":"publish","type":"post","link":"https:\/\/www.nivas.hr\/blog\/2006\/11\/14\/globaltolocal-localtoglobal-meet-localtolocal\/","title":{"rendered":"GlobalToLocal \/ LocalToGlobal? Meet &#8211; localToLocal!"},"content":{"rendered":"<p><a target=\"_blank\" href=\"http:\/\/www.rockonflash.com\/blog\/?p=18\">John Grden<\/a> came up with great idea to deal with coordinate conversion in Flash &#8211; localToLocal! He first implemented it way back in Flash6.<\/p>\n<p><code> class com.rockonflash.utils.CoordinateTools<br \/>\n{<br \/>\npublic static function localToLocal(from:MovieClip, to:MovieClip, origin:Object):Object<br \/>\n{<br \/>\nvar point:Object = origin == undefined ? {x: 0, y: 0} : origin;<br \/>\nfrom.localToGlobal(point);<br \/>\nto.globalToLocal(point);<br \/>\nreturn point;<br \/>\n}<br \/>\n}<\/code><\/p>\n<p>Just use it to create your point object and you\u2019re done:<\/p>\n<p>var point:Object = CoordinateTools.localToLocal(from:MovieClip, to:MovieClip);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>John Grden came up with great idea to deal with coordinate conversion in Flash &#8211; 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; from.localToGlobal(point); to.globalToLocal(point); return point; } } Just use&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/83"}],"collection":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":0,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}