Is there any way to find out at any time if the mouse button is down?
I have some code that runs while the mouse button is down, but if I switch away from the Flash client while the mouse button is down, then the mouse up listeners are never called, so I’d like to account for this situation by checking if the mouse button is still down.
Ideally, I’d like something like:
if (Mouse.isDown) {
trace("down");
} else {
trace("up");
}
I ended up adding an
Event.ACTIVATElistener. Whenever Flash receives focus, I check if the mouse button is considered to be down. Since the mouse button can’t be down inside the Flash client before the Flash client receives focus, I can safely assume that it should be up and call the appropriate code.