Search tutorials
Create a dummy MovieClip
- Create a small rectangle and convert it into a MovieClip.
- This MovieClip will act as the Listener for mouse movements.
- Left-click on the MovieClip and open up the Actions Pane. Write the following code:
onClipEvent(load)
{
id=1;
}
onClipEvent(enterFrame)
{
diffX=_root._xmouse-_root.mouseX;
diffY=_root._ymouse-_root.mouseY;
if (diffX!=0 || diffY!=0)
{
duplicateMovieClip("_root.trail", "trail"+id, id+10);
_root["trail"+id]._x+=random(20);
_root["trail"+id]._y+=random(20);
if (id>100)
{
id=1;
}
else
{
id++;
}
}
}
{
id=1;
}
onClipEvent(enterFrame)
{
diffX=_root._xmouse-_root.mouseX;
diffY=_root._ymouse-_root.mouseY;
if (diffX!=0 || diffY!=0)
{
duplicateMovieClip("_root.trail", "trail"+id, id+10);
_root["trail"+id]._x+=random(20);
_root["trail"+id]._y+=random(20);
if (id>100)
{
id=1;
}
else
{
id++;
}
}
}
» Level Intermediate |
Added: 2006-04-08 Rating: 3.63 Votes: 8 |
» Author |
College student 19 years old, Interests - Computers, Sports |
» Download |
Download the files used in this tutorial. |
Download (0 kb) |
» Forums |
More help? Search our boards for quick answers! |