I have a customized drag event that works great for most things:
stage.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
function beginDrag( e:MouseEvent )
{
stage.addEventListener( MouseEvent.MOUSE_MOVE, drag );
stage.addEventListener( MouseEvent.MOUSE_UP, endDrag );
stage.addEventListener( MouseEvent.DEACTIVATE, endDrag );
stage.addEventListener( Event.MOUSE_LEAVE, endDrag );
stage.addEventListener( Event.REMOVED_FROM_STAGE, stageEndDrag );
//trigger beginDrag event
}
function drag( e:MouseEvent )
{
//trigger drag event
}
function endDrag( e:Event )
{
stage.removeEventListener( MouseEvent.MOUSE_MOVE, drag );
stage.removeEventListener( MouseEvent.MOUSE_UP, endDrag );
stage.removeEventListener( MouseEvent.DEACTIVATE, endDrag );
stage.removeEventListener( Event.MOUSE_LEAVE, endDrag );
stage.removeEventListener( Event.REMOVED_FROM_STAGE, stageEndDrag );
//trigger endDrag event
}
The issue is that when I use this code with wmode=transparent
or wmode=opaque
the MOUSE_LEAVE
event is not detected when the MOUSE_UP
event occurs off the stage.
Is there a way to detect the MOUSE_LEAVE
event when wmode
is transparent
or opaque
?
OR
Is there a way to detect that the wmode
is set to transparent
or opaque
so that a work-around may be implemented?