简体   繁体   中英

About flickering mouse custom cursor in ActionScrip3

I have a problem with flickering mouse custom cursor. I have a timeline which is my main clip and I want to show a pencil like cursor when I am over the timeline movie clip. I am using standard Mouse events, MOUSE_OVER and MOUE_OUT, MOUSE_MOVE. Also I use Mouse.hide()/show() functions to show and hide the mouse. Also the same principal or the pencil movie clip which I show and Hide.

On MOUSE_MOVE is set the coordinates of the pencil movieclip to be those on the Mouse cursor.

How ever I get a flickering of the mouse and the pencil movieclip while above the timeline movieclip. So they change from one to another all the time without stopping ie filckering.

Any idea what is my problem?

(I am not using any code for this in enter_frame function)

    public function setMouseOver(e:MouseEvent):void {////on MOUSE_OVER

       pencilCursor.visible = true;
       Mouse.hide();
       mouseOverCont = true;
    }
    public function unsetMouseOver(e:MouseEvent):void {////on MOUSE_OUT
       pencilCursor.visible = false;
       Mouse.show();
       mouseOverCont = false;
    }
    public function showHoverBaloon(e:MouseEvent):void {////on MOUSE_MOVE
       pencilCursor.x = stage.mouseX;
       pencilCursor.y = stage.mouseY;

    }

Sounds like "something" gets in the way of the mouse cursor and triggers OVER and OUT events.

Set mouseEnabled and mouseChildren to false on "pencilCursor".

pencilCursor.mouseEnabled = false;
pencilCursor.mouseChildren = false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM