I can't say it's clear to me, but what you might want to do is search Google for "AS3 localToGlobal" or "AS3 globalToLocal" (or use AS2 instead of AS3)
i just want to change the flash interface to use a global coordinate system when im bulding the applications so i can locate symbols in the exact same location. is that possible i looked in preferances and i did not see this option.
thanks again for your help
1 person found this helpful
One of the ways is to read getRect() or getBounds() relative to the object. The following code demonstrates that coordinates are different depending what objects you refer to:
var sp1:Sprite = new Sprite(); sp1.x = 10; sp1.y = 20; var g:Graphics = sp1.graphics; g.beginFill(0xff0000); g.drawRect(0, 0, 30, 30); g.endFill(); var sp2:Sprite = new Sprite(); sp2.x = 100; sp2.y = 100; var sp3:Sprite = new Sprite(); sp3.x = 33; sp3.y = 21; sp2.addChild(sp1); sp3.addChild(sp2); addChild(sp3); trace(sp1.getRect(stage)); // (x=143, y=141, w=30, h=30) trace(sp1.getRect(sp2)); //(x=10, y=20, w=30, h=30) trace(sp1.getRect(sp3)); // (x=110, y=120, w=30, h=30)
Thank you both for the help, but I’m talking much simpler than that. I'm looking for a preference in the program that will show me the x & y coordinates in a global coordinate system,
When I have a movie symbol and I imbed text in it, I can type in that it is x=256 y= 256 currently if I want to embed text in the same location @ the root the x & y coordinates will not be the same (x=256 y=256) because the embedded text (coordinate system) is relative to the position of the movie symbol that it is embedded in.
I don’t explain myself very well thank you for trying to help
Any symbol you create essentially has it's own corrdinate system, and you can't have things referenced to the main timeline's coordinate system as any kind of design feature in the Flash editor.