
Custom Mouse Cursor Tutorial in Flash ActionScript 3.0: CS3 + CS4
In this free Flash ActionScrpt 3.0 tutorial you can learn how to easily create custom mouse pointers and cool animated cursors for your Flash CS3 + CS4 projects coded with ActionScript 3.0. Simply create any movieclip, give it an instance name, and apply the code shown. You can get to the free source file above, but I recommend you code it out yourself. Just follow along witht the video to gain a full understanding about what each line of code is doing.
Lesson Code
[php]
stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor);
Mouse.hide();
function redrawCursor (event:MouseEvent):void {
myCursor_mc.visible = true;
myCursor_mc.x = event.stageX;
myCursor_mc.y = event.stageY;
}
function hideCursor (event:Event):void {
myCursor_mc.visible = false;
}
[/php]