1
我是新來的as3,我需要做一件非常簡單的事情。我有以下代碼,它工作得很好。但我需要什麼,不能弄清楚如何做到這一點是:如何在as3的MOUSE_DOWN上使用不同的鼠標光標?
- 改變鼠標光標,當我拿着鼠標中鍵(從符號選擇)
與它(移動通常會消失時能力我用鼠標移動)
import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import fl.motion.MotionEvent; var CursorStill: Sprite; var CursorAnim: Sprite; function init() { Mouse.hide(); CursorStill = new CursorStillClass(); CursorStill.mouseEnabled = false; CursorStill.visible = false; addChild(CursorStill); stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); } function mouseMoveHandler(evt: MouseEvent): void { CursorStill.visible = true; CursorStill.x = evt.stageX; CursorStill.y = evt.stageY; evt.updateAfterEvent(); } function mouseLeaveHandler(evt: Event): void { CursorStill.visible = false; } function mouseDownHandler (evt: MouseEvent): void { CursorStill.visible = false; } init();