A clip's x,y location is always relative to it's parent. So unless it's a child of the stage, or the parent is at 0,0 - you can use localToGlobal to give you it's location on the stage.
var globalPoint:Point = myClip.localToGlobal(new Point(0,0));
That would give you the global position of that clip.
But from the sounds of it, you want to go the other way and do globalToLocal right ?
globalToLocal will return a local position , based on a global location.
So if you wanted to set a clip's local position so that it will be positioned at center of the screen -- lets assume it's 320,240.
var localPoint:Point = myClip.parent.globalToLocal(new Point(320,240));
myClip.x = localPoint.x;
myClip.y = localPoint.y;
We use the parent, because thats what the clip will be be relative to.
make sense?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…