Mouse Cursor Bubbles Particle Effect
| Category | : Flash | Views | : 34501 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : mouse-cursor-bubbles-particle-effect.zip | ||
| Result | : See the result | ||||
Set the identifier to "Bubble"; go to the first frame of the main timeline and paste:
//to create new bubbles
bubbles = 0
_root.onEnterFrame = function()
{
//attach new Bubble Movie Clips
_root.attachMovie("Bubble", "Bubble" + bubbles, _root.getNextHighestDepth());
//increase variable by 1
bubbles++
}
If you want make a gradient background for your movie; draw a square and fill it with a linear gradient.

As the Bubble Movie Clip is transparent in some parts it will appear differently on some parts of you movie.
Done! Just test your movie (Ctrl + Enter) to see the results.
Code Explanation
this._x=_root._xmouse
this._y=_root._ymouse
Set the coordinates of this Movie Clip to be equal to the mouse.
this._xscale = this._yscale = Math.random() * 40 + 10
Set the scale of the Movie Clip to a random number between 10 and 50.
var xSpeed = Math.random() * 6 3
Get a random _x speed between -3 and 3.
var ySpeed = 2
this.onEnterFrame = function()
{
this._x += xSpeed
this._y -= ySpeed
Move the Movie Clip in the _x and _y coordinate.
this._alpha -= 1;
Decrease alpha by 1.
if(_alpha == 0)
{
this.removeMovieClip();
}
}
If alpha equal 0 the Movie Clip is not visible so remove it.
bubbles = 0
Declare this variable to create new Movie Clips.
_root.onEnterFrame = function()
{
_root.attachMovie("Bubble", "Bubble" + bubbles, _root.getNextHighestDepth());
Attach new bubbles.
bubbles++
}
Increase this variable by 1.