1
在我的应用程序中,我有一个连接鼠标的鼠标光标。但是,它不会让我点击我的应用程序中的按钮,这对我来说是一个很大的问题,因为按钮对于我需要做的事情至关重要。AS3 - 如何让鼠标光标点击按钮?
我是新来的AS,所以任何帮助将不胜感激!
stage.addEventListener(MouseEvent.MOUSE_MOVE, draw_cursor);
stage.addEventListener(Event.MOUSE_LEAVE, hide_cursor);
Mouse.hide();
function draw_cursor(event:MouseEvent):void
{
my_cursor_mc.visible = true;
my_cursor_mc.x = event.stageX;
my_cursor_mc.y = event.stageY;
}
function hide_cursor(event:Event):void
{
my_cursor_mc.visible=false;
}
我试图用这个(下同),但很glichy,不得不按下按钮,光标消失,那么我能够按一下按钮(不甚理想):
stage.addEventListener(MouseEvent.CLICK, hide_cursor);
支持适当的自定义原生的鼠标光标是在Flash Player 10.2增加。你可以在这里了解它:http://www.adobe.com/devnet/flashplayer/articles/native-mouse-cursors.html –
非常优秀的链接,感谢分享。我会推荐使用本地鼠标光标作为亚当建议。 – ToddBFisher
[actionscript 3事件中的自定义光标可能重复不起作用](https://stackoverflow.com/questions/2528709/custom-cursor-in-actionscript-3-event-doesnt-work) –