关于 ActionScrip3 中闪烁的鼠标自定义光标

发布于 2024-12-05 17:39:30 字数 855 浏览 1 评论 0原文

我遇到了鼠标自定义光标闪烁的问题。 我有一个时间线,这是我的主要剪辑,当我位于时间线影片剪辑上方时,我想显示一个像铅笔一样的光标。我正在使用标准鼠标事件,MOUSE_OVER 和 MOUE_OUT,MOUSE_MOVE。我还使用 Mouse.hide()/show() 函数来显示和隐藏鼠标。还有我显示和隐藏的相同主体或铅笔影片剪辑。

在 MOUSE_MOVE 上,将铅笔动画剪辑的坐标设置为鼠标光标上的坐标。

当我在时间轴动画片段上方时,鼠标和铅笔动画片段如何闪烁。因此,它们一直在从一种变化到另一种,而不停止,即闪烁。

知道我的问题是什么吗?

(我没有在 Enter_frame 函数中使用任何代码)

    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;

    }

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 i.e 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;

    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

因为看清所以看轻 2024-12-12 17:39:30

听起来像是“有东西”挡住了鼠标光标并触发了 OVER 和 OUT 事件。

将“pencilCursor”上的 mouseEnabledmouseChildren 设置为 false

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

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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文