【AS3代码】隐藏原有鼠标箭头,并自定义鼠标小箭头
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.ui.Mouse;
public class Main extends Sprite
{
var arr:arrow = new arrow(); //自己做的鼠标小箭头(影片剪辑MC)
public function Main():void
{
init();
}
private function init():void
{
Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME, aa);
arr.mouseEnabled = false; //自定义鼠标小箭头不接收鼠标事件
this.addChild(arr);
}
public function aa(e:Event):void
{
arr.x = this.mouseX;
arr.y = this.mouseY;
}
}
}
{
import flash.display.Sprite;
import flash.events.Event;
import flash.ui.Mouse;
public class Main extends Sprite
{
var arr:arrow = new arrow(); //自己做的鼠标小箭头(影片剪辑MC)
public function Main():void
{
init();
}
private function init():void
{
Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME, aa);
arr.mouseEnabled = false; //自定义鼠标小箭头不接收鼠标事件
this.addChild(arr);
}
public function aa(e:Event):void
{
arr.x = this.mouseX;
arr.y = this.mouseY;
}
}
}