0

I'm working on adding a custom cursor in AS3 via startDrag(). On a mac, it works fine. You rollover your flash file and the custom MC snaps to the mouse. On a pc, on load, the cursor immediately jumps to wherever your mouse is OUTSIDE the flash file. A good example to test is this:

http://www.republicofcode.com/tutorials/flash/as3customcursor/

Try to refresh this page on a pc vs. mac and you'll see the initial position of that cursor to be different. On PC it jumps. How do I resolve? Thank you,

Jan

BadFeelingAboutThis
  • 14,445
  • 2
  • 33
  • 40

1 Answers1

0

You could try delaying the drag until after a mouse move event that is in bounds of the stage.

stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);

function mouseMoveHandler(e:MouseEvent):void {
    if(e.stageX > 0 && e.stageX < stage.stageWidth && e.stageY > 0 && e.stageY < stage.stageHeight){
        stage.removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
        cursor_mc.startDrag(true);
    }
}
BadFeelingAboutThis
  • 14,445
  • 2
  • 33
  • 40