Skip to main content
Inspiring
May 26, 2009
Answered

Reading a click event even when its state is not captured; so not "clicked"?

  • May 26, 2009
  • 1 reply
  • 755 views

Hello

Im working on menu where I need to capture a "holded" mouse click in order to register a second event handler.

Only problem is that the click is "on hold", meaning that the mouse button is beeing pressed and "holded" - so its not be catched by Flash's "MouseEvent.CLICK" listener as completed "CLICK".

Is there any workaround to capture this event before its registered as a completed click? - Maybe using the "useCapture" flag of the event handler?

This topic has been closed for replies.
Correct answer Rothrock

I'm sure this post makes sense to you since you know what you are doing. But I'm not really following it. You've got an awful lot of versions of "to click" and "to hold" in there. Are you saying you need to differentiate between a click (a press and release) and a hold (press and hold)?

In that case don't use MouseEvent.CLICK use MouseEvent.MOUSE_DOWN and MouseEvent.MOUSE_UP and maybe a Timer or something to register that it has been held long enough?

Am I close? Getting the general idea?

1 reply

RothrockCorrect answer
Inspiring
May 26, 2009

I'm sure this post makes sense to you since you know what you are doing. But I'm not really following it. You've got an awful lot of versions of "to click" and "to hold" in there. Are you saying you need to differentiate between a click (a press and release) and a hold (press and hold)?

In that case don't use MouseEvent.CLICK use MouseEvent.MOUSE_DOWN and MouseEvent.MOUSE_UP and maybe a Timer or something to register that it has been held long enough?

Am I close? Getting the general idea?

Inspiring
May 26, 2009

Im truly sorry, my english sometimes is awful.

But you gave me the right hint, simply editing my event handler, replacing the MouseEvent.CLICK with MouseEvent.MOUSE_DOWN has done the trick

Just for sake of topic, I meaned, the mouse button beeing pressed and holded. My menu is working fine now, thx! (cheers)

Inspiring
May 26, 2009

No problem and you did get the point across. Glad it worked out for you.