Welcome Guest | Signup | Login

Tutorials

 

Tutorials >> Mouse Cursor Particle Effect
DOWNLOAD SOURCE FILE FOR THIS TUTORIAL

Posted by webzo

This is a nice effect simply using Motion Tween and some actionscript:

obrazek

You need to create four Movie Clips; draw one ball in each of them and give different colors:

obrazek

Then create another Movie Clip and place the Ball Movie Clips inside it, like this:

obrazek

Each Movie Clip needs to be in a different layer so we can tween it.

Now create another layer for each Movie Clip layer and draw the path you want the Movie Clip to follow using the Pencil Tool.

obrazek

Set the layers with the paths to "guides" and drag the layer with the Movie Clips below each guide.
Insert a key frame on frame 30 in all layers.

On the last frame of the Movie Clip's layers drag the Movie Clips to the end of the path and set their alpha to 0:

obrazek

Now create a Motion Tween in all Movie Clip's layers:

obrazek

On the last frame of this Movie Clip paste:
Code: Select all//remove Movie Clip
this.removeMovieClip();
Set the identifier for this Movie Clip to "MCTween" and go back to the main timeline.

Open the actions for the first frame and paste:
Code: Select all//to attach new Movie Clips
var count = 0;

//when the mouse is moved
_root.onMouseMove = function()
{
//attach our Movie Clip
_root.attachMovie("MCTween", "MCTween" + count, count);

//set the coordinates to be equal to the mouse
_root["MCTween" + count]._x = _xmouse;
_root["MCTween" + count]._y = _ymouse;

//random rotation between 0 and 360
_root["MCTween" + count]._rotation = Math.round(Math.random() * 360);

//increase "count" by 1
count++
}
We rotate the Movie Clip to make them look different because they are exactly the same Movie Clip, but the effect is great.[st]Code Explanation[/st]
Code: Select all_root.onMouseMove = function()
{
_root.attachMovie("MCTween", "MCTween" + count, count);
_root["MCTween" + count]._x = _xmouse;
_root["MCTween" + count]._y = _ymouse;
Create a new Movie Clip and set its position to be equal to the mouse.
Code: Select all_root["MCTween" + count]._rotation = Math.round(Math.random() * 360);
Rotation the Movie Clip to a random angle will make every Movie Clip seem unique even if they are the exactly same Movie Clip.
Code: Select allcount++
}
Increase this variable to create new Movie Clips with different names and depths.