This *has* to be an easy AS3 question...

This has to be an easy AS3 question…doesn’t it?

I am not seeing the below code in MOUSE_DOWN fired, until I lift the mouse button back up.

This happens even on a new FLA, with only MOUSE_DOWN, MOUSE_UP and CLICK handler code – nothing else.

Regardless of what I do, I only see MOUSE_DOWN, MOUSE_UP and CLICK traced out AFTER I lift (release) the mouse button…
See code below.

It happens if I attach the handlers to the stage;
or to a sprite.

It happens with/without buttonMode being set.

It happens with/without preventDefault() being called in CLICK…

It happens using event:MouseEvewnt or event:Event as some have suggested.

When I click, I see nothing.
When I release, I see this:
Mouse down
Mouse up
Mouse CLICK

Why don’t I see “Mouse down” when clicking (before releasing)?

What the heck am I missing here?

Thank you!

stage.addEventListener(MouseEvent.CLICK, function(event:MouseEvent)
                       {                  
                         // event.preventDefault();  
                         trace("Mouse CLICK");   
                       } );

stage.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent)
                       {
                           
                        // event.preventDefault();  
                         trace("Mouse down");   
                       } );
                       

stage.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent)
                       {                      
                         // event.preventDefault();
                         trace("Mouse up");
                       } );
                       





stage.addEventListener(MouseEvent.CLICK, function(event:Event)
                       {                  
                         event.preventDefault();  
                         trace("Mouse CLICK");   
                         _mouse = "click";
                       } );

_sprite.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event)
                       {
                           
                        // event.preventDefault();  
                         trace("Mouse down");   
                         _mouse = "down";
                       } );
                       

_sprite.addEventListener(MouseEvent.MOUSE_UP, function(event:Event)
                       {
                           
                         event.preventDefault();
                         trace("Mouse up");
                         _mouse = "up";
                       } );

Works for me. Maybe something is blocking your trace output? If you put timestamps in your traces, do they show a time gap between down and up?

thank you @senocular

I found the problem.

It was a Logitech wireless keyboard issue (development machine).

The keyboard’s touchpad tap to emulate a click does not trigger a ‘real’ click.
It passes a MouseEvent.CLICK but not a MOUSE_DOWN (!).

I have never run into something like that before :frowning:

It was a real pain – as I would not have guessed that could be a problem.

Moved to a different machine and it worked.

Thank you.