I'm getting an unusual behavior that I can't seem to get to the bottom of. When I run this, if I move in the swf area it traces normally on mouse move. To be expected.
But it's tracing for the move event when I click anywhere on screen. If I click and drag, it traces as if I were moving in the swf area of the browser.
Here's the code. I've simplified to it's barebones. Just put this in in an empty AS3 project in Flex called "Engine" - sans quotes obviously.
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
[SWF(width='640', height='360', backgroundColor='#888888', frameRate='31')]
public class Engine extends Sprite
{
public function Engine()
{
// Add the mouse handlers
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
public function mouseMoveHandler(evt:MouseEvent):void
{
trace("move");
}
}
}
As a workaround I've add the MOUSE_MOVE one MOUSE_OVER and remove it on MOUSE_OUT. But the behavior still seems quite unusual and I'd be interest in understanding why it's happening.
Can anyone tell me how I can keep the events constrained to the actual stage of the application?