开发者

ActionScript 3 addEventListener to a Sprite

I try to add an 开发者_Python百科event handler to a sprite object but it doesn't affect anyway what is my problem?

...
my_sprite_object.addEventListener(MouseEvent.CLICK, handleEvent);

addChild(my_sprite_object);
...


public function handleEvent(event:MouseEvent):void {
//do some stuff here
}

Sultan


Have you set the Sprite.buttonMode to true?

If yes, can it be that something else is already capturing the click event and is not letting it bubble further?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜