我在这里有这个http://www.nzombie.eshost.es/带有自定义鼠标。它工作得很好,只是当它在另一个电影剪辑后面时它会“隐藏”自己。我不知道怎么了。任何建议或帮助将不胜感激。这是鼠标类:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.ui.Mouse;
public class myCursor extends MovieClip
{
public function myCursor(stage):void
{
stop();
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
addEventListener(Event.REMOVED_FROM_STAGE, onRemove);
}
private function updateCoor(e:MouseEvent):void
{
x = e.stageX;
y = e.stageY;
e.updateAfterEvent();
}
private function onDown(e:MouseEvent):void
{
updateCoor(e);
gotoAndStop(2);
}
private function onUp(e:MouseEvent):void
{
updateCoor(e);
gotoAndStop(1);
}
private function onMove(e:MouseEvent):void
{
Mouse.hide();
updateCoor(e);
}
private function onRemove(e:Event):void
{
Mouse.show();
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
removeEventListener(Event.REMOVED_FROM_STAGE, onRemove);
}
}
}