Flash: tracking mouse position after clicking and dragging (down and back), even outside the scene / browser?

What is the right way to track mouse position from Adobe Flash when someone has:

  • Drag and drop started in Flash application (MOUSE_DOWN event),
  • Drag the mouse outside the application or even into the browser window (MOUSE_MOVE event) and
  • Mouse button released (MOUSE_UP event)?

For example (suppose Qaru is a Flash application):

enter image description here

In the application, I can track the X and Y mouse positions using the MOUSE_MOVE event listener, but I lose it when it goes outside the browser ...

So, how can I track the position of the mouse no matter where it goes?

Google Finance. ; - , , , .

, KOKO KAKA; ( ) , , .

, , MOUSE_DOWN "" , Flash , .

?

! ♥

+3
2

MouseEvent.MOUSE_MOVE. fla Dynamic TextField, "output" .

import flash.events.MouseEvent;

stage.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDownHandler );
stage.addEventListener( MouseEvent.MOUSE_UP, onMouseUpHandler );

function onMouseDownHandler ( evt : MouseEvent ) : void
{
    outputText( "Mouse Down" );
    stage.addEventListener( MouseEvent.MOUSE_MOVE, onMouseMoveHandler );
}

function onMouseUpHandler ( evt : MouseEvent ) : void
{
    outputText( "Mouse Up" );
    stage.removeEventListener( MouseEvent.MOUSE_MOVE, onMouseMoveHandler );
}

function onMouseMoveHandler ( evt : MouseEvent ) : void
{
    outputText( "Mouse move" );
    outputText( "Mouse Y: " + mouseY );
    outputText( "Mouse X: " + mouseX );
}

function outputText ( outputString : String ) : void
{
    output.appendText( "\n" + outputString );
}

, , , x y pos . swf .

+2

- MOUSE_LEAVE, , -, JavaScript Flash, ( , ..).

0

Source: https://habr.com/ru/post/1792851/


All Articles