Thursday, August 20, 2009

Custom Cursor in Actionscript 3.0

I found 2 way of create the custom cursor.

First you need to create your own mouse cursor. Then you put it into a movie clip. After that, give an instant name to it (cursor_mc). Place your custom made cursor on the stage.

In the actionscript 3.0 you write this :

First Option


Mouse.hide();
cursor_mc.startDrag(true);

Second Option
Mouse.hide();
function doEveryFrame(e:Event){
cursor_mc.x=(this.mouseX);
cursor_mc.y=(this.mouseY);
}
this.addEventListener(Event.ENTER_FRAME,doEveryFrame);

Next, Ctrl+ Enter...
And that's all. your very own custom made cursor

Flash CS3 - Actionscript 3.0

I'm a beginner in actionscript 3.0 but i would like to share what I learn to you guys. hope my sharing and tips can help you.