New Blog, Cursor Effects
Hey, welcome to my new blog!
This new blog will make it tons easier for me to keep you posted on news from Kabomb, as well as flash related news from around the web. I’ll also be able to post open source tutorials, prototypes, and flash experiments that you can follow. You’ll be able to comment on all my posts and I’ll try to reply to the ones that need a reply, if not just email me.
If you have no idea what flash is or you want to get into it, you can download a free trial from the Adobe Website where you’ll also need flash player (you should already have it) to see all the examples on your web browser.
Okay, let’s get down to business - my first tutorial - Cursor Effects. This lets you create effects like those in my Cursorized series where MC animations continually come out at the cursor which creates a really cool effect.
Here’s what I did.

Now I’ll explain how I did it.
AS3
First create a blank MC with an instance name of ‘Effect’ (no quotes, case sensitive). Click on ‘Advanced’ (if you haven’t already) and select ‘Export for Actionscript’. Click OK. Now you have to create a simple animation that will be the basis of the effect.
Create a blank keyframe after the last frame of the animation, and put this code there:
This removes the MC from being visible, and stops it so it isn’t needed any more.
On the main timeline, insert this code:
We create a function called ‘EF’ (EnterFrame) which will be executed once every frame.
In this function, we create a variable called ‘effect’ in the ‘Effect’ class. You created the ‘Effect’ class when you selected ‘Export for Actionscript’. In other words, we’re creating a new MC based on the ‘Effect’ instance.
This MC needs to be visible, so we add the child so it can now be viewed by the viewer.
The next lines determine what happens to the effect just as it has been created. Here, we set the effect’s x and y positions to the mouse, and make the rotation random from 0 to 360. You can change or add code to this if you want, you could make the x and y positions random or whatever.
Finally we add a listener to the function, the listener type is ‘ENTER_FRAME’ (so it’s executed each frame) and the name of the function is ‘EF’.
Export your movie and see what you came up with! You can try out tons of effects, just experiment a little.
First create a blank MC with an instance name of ‘effect’ (no quotes). Click on ‘Advanced’ (if you haven’t already) and select ‘Export for Actionscript’. Click OK. Now you have to create a simple animation that will be the basis of the effect.
Create a blank keyframe after the last frame of the animation, and put this code there:
This removes the MC so it isn’t needed anymore.
On the main timeline, insert this code:
The variable ‘i’ is set to zero. This will be the basis for uniquely naming MCs and giving them a unique depth.
The ‘onEnterFrame’ function executes the code within it each frame.
‘i++’ means 1 is added onto ‘i’ each frame, so it will go from 1 to 2, 3, 4, etc.
Then we create and effect MC and the MC we made in the library is attached to it, with a unique depth and name of whatever ‘i’ is. With this MC, we set the x and y to the mouse’s position, and give it a random rotation. You can do whatever you want here.
Export your movie and see what you came up with! You can try out tons of effects, just experiment a little.
Tags: cursor effects
July 22nd, 2008 at 12:02 am
flash game tutorials…
Six Apart started a working group in February 2006 to improve the Trackback protocol with the goal to eventually have it approved as…