我正在尝试在 adobe edge 中制作一个自定义光标,但没有太多成功,所以我希望有人可以帮助我。
这些是我尝试过的代码;
var myCursor = new ball();// as linkage to be done in the library
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);
function follow(evt:MouseEvent){ addChild(myCursor);
myCursor.x = mouseX;
myCursor.y = mouseY;
}
stage.addEventListener(Event.MOUSE_LEAVE,vanish);
function vanish(event:Event){ removeChild(myCursor);
}
和
.next:hover { cursor:url(img/right-pointer.png); }
和
stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor);
Mouse.hide();
function redrawCursor (event:MouseEvent):void {
sikte.visible = true;
sikte.x = event.stageX;
sikte.y = event.stageY;
}
function hideCursor (event:Event):void { sikte.visible = false; }