开发者

ActionScript 3 addEventListener to a Sprite

开发者 https://www.devze.com 2023-01-28 16:39 出处:网络
I try to add an 开发者_Python百科event handler to a sprite object but it doesn\'t affect anyway what is my problem?

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

精彩评论

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