Actionscript 3 AS3:显示对象x、y的点?

Actionscript 3 AS3:显示对象x、y的点?,actionscript-3,hittest,displayobject,Actionscript 3,Hittest,Displayobject,现在我有一个点,我必须用一个显示对象的x和y来更新它,以便与hitTestPoint对象一起使用;是否有任何方法可以从显示对象中获取点,而无需创建新的点变量并不断更新其x和y?尝试以下方法: // Your display object you want to get the position from var something:DisplayObject; // Retrieve the position as a Point object var position:Point = so

现在我有一个点,我必须用一个显示对象的x和y来更新它,以便与hitTestPoint对象一起使用;是否有任何方法可以从显示对象中获取点,而无需创建新的点变量并不断更新其x和y?

尝试以下方法:

// Your display object you want to get the position from
var something:DisplayObject; 

// Retrieve the position as a Point object
var position:Point = something.transform.pixelBounds.topLeft;