We all now what the swirling line thing can do. A mouse effect which creates a filled layer trail.
var points:Array = new Array();
var prev_xmouse:Number;
var prev_ymouse:Number;
this.onEnterFrame = function():Void {
this.clear();
this.lineStyle(1, 0xff0000, 0x00ff00, 0x0000ff); //
[COLOR=#000000]**var**[/COLOR] colors:[COLOR=#0066cc]Array[/COLOR] = [COLOR=#006600]**[**[/COLOR]0xff0000, 0x00ff00, 0x0000ff[COLOR=#006600]**]**[/COLOR];
//this.linestyle(gradient fill as if its a rainbox of colors)
//i want different colors coming out
var dx:Number = this._xmouse - prev_xmouse;
var vx:Number = dx ? dx : Math.random() * randSet(-1, 1);
var dy:Number = this._ymouse - prev_ymouse;
var vy:Number = dy ? dy : Math.random() * randSet(-1, 1);
var pLen:Number = points.push({x:this._xmouse, y:this._ymouse, vx:vx / 10, vy:vy / 10, life:getTimer()});
for (var i:Number = 0; i < pLen; i++) {
if (getTimer() - points*.life > 1000) {
points.splice(i--, 1)[0];
} else {
if (i && points*) {
points*.x += points*.vx;
points*.y += points*.vy;
var cx:Number = points[i - 1].x;
var cy:Number = points[i - 1].y;
this.curveTo(cx, cy, (points*.x + cx) / 2, (points*.y + cy) / 2);
} else {
this.moveTo(points*.x, points*.y);
}
}
}
prev_xmouse = this._xmouse;
prev_ymouse = this._ymouse;
};
function randSet():Number {
return arguments[Math.floor(Math.random() * arguments.length)];
}
loop.this.movie();
I edited the code above.
I want it so when someone moves the mouse across the screen a color is coming out, say for three seconds its blue, then it blends to red (thats why i put alpha at 12) and obviously added the loop! So it does not stop