Thank you for taking the time to read my question.
So, I have a movieclip which i add to the stage, inside it there’s an instance of another movieclip. let’s call the other first movieclip A. The instance name of the second will be thing. So I do:
var a:A = new A();
stage.addChild(a);
And that’s fine the coordinates of the a are fine but a.thing.x is always based on how far it is from a. Is there any way to make a.thing.x to display on the stage’s coordinate system?
I hope I made my question clear enough.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#globalToLocal%28%29
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#localToGlobal%28%29
Answer to your question in comments:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7df5.html
“x” and “y” properties of DisplayObject relative to the 0,0 coordinate of its parent display object’s axes.
So if “a” MovieClip located in (10, 50) point and “thing” MovieClip located in (20, 40) point inside “a” MovieClip then in order to find absolute coordinates of “thing” MovieClip we should to calculate:
x = “x” coordinate of “a” MovieClip + “x” coordinate of “thing” MovieClip = 10 + 20 = 30
and
y = “y” coordinate of “a” MovieClip + “y” coordiante of “thing” MovieClip = 50 + 40 = 90
But because there are possible several nested parent DisplayObjects so usage of localToGlobal and globalToLocal methods instead of
absoluteX = x of my movieclip + x of my movie clip parent + x of parent of my movie clip parent and so on
is more convenient