possible to turn MouseEvent.CLICK off after receiving an event?

3 posts

Flag Post

I have a menu and some dialog, you can activate the menu options with the keyboard or mouse.

The dialog window isn’t very large, so you need to press space or mouse click it to advance the text.

The problem is when you mouse click a dialog option, and following is a long dialog that should would wait for a MouseEvent.Click. The dialog will advance as if it’s already received a click. There is no button overlap between the two. Only by using a trace or the keyboard commands can I see that the text does display correctly. It’s only when using the mouse that it ‘skips’. It feels like the event is carrying over the previous MouseEvent.Click from clicking a dialog option. No idea why it’s doing this. So I’m curious if there is a way to turn off the MouseEvent state after receiving that first click.

I’m not willing to post and explain extensive code. Just asking if such a thing is possible and how. Thanks.

Flag Post

You can remove the event listener using

removeEventListener(MouseEvent.CLICK, event handler );

Flag Post

Yea, I was only removing the dialog option buttons before I create the button for the dialog to advance. I’ll try removing the listeners then the buttons.

I was just reading the adobe website and changed the dialog options to be (MouseEvent.CLICK, buttonFunction,false); and the dialog itself to (MouseEvent.CLICK,dialogFunction,true);
I don’t understand enough about AS3 to know what the different phases are, but this works.