ape物理引擎中的对象拖动实现方法

粒子对象.sprite.addEventListener(MouseEvent.MOUSE_DOWN, downHandle);
粒子对象.sprite.addEventListener(MouseEvent.MOUSE_UP, upHandle);
function downHandle(e:MouseEvent):void
{
e.target.startDrag();
removeEventListener(Event.ENTER_FRAME, run);
}
function upHandle(e:MouseEvent):void
{
e.target.stopDrag();
addEventListener(Event.ENTER_FRAME, run);
}

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>