I have a bit of code that changes the color of lines eminating from the curser. You can see the way it looks at this site.
I have tried to change the code to make it all one color.(#FF0066)
And I need help because I am stuck.
The code goes into a frame action.
I'd gladly pay you on Thursday
for a hamburger today!
I have tried to change the code to make it all one color.(#FF0066)
And I need help because I am stuck.
The code goes into a frame action.
Code:
stop();
p = new Array();
count = 0;
p[count] = {x:_xmouse, y:_ymouse, w:0, col:0};
count++;
rand = Math.random;
sin = Math.sin;
r = 255; //rand() * 128 + 127;
g = 127; //rand() * 128 + 127;
b = 0; //rand() * 128 + 127;
w = 0;
ri = 0.02; //rand() * 0.05;
gi = 0.015; //rand() * 0.05;
bi = 0.025; //rand() * 0.05;
this.onEnterFrame = function() {
vx = _xmouse - oldx + rand() * 2 - 1;
vy = _ymouse - oldy + rand() * 2 - 1;
oldx = _xmouse;
oldy = _ymouse;
p[count] = { x:_xmouse, y:_ymouse, vx:vx * 0.5, vy:vy * 0.5, w:(sin(w += 0.2)*5 + 5),
col:(sin(r += ri) * 128 + 127) << 16 | (sin(g += gi) * 128 + 127) << 8 | (sin(b += bi) * 128 + 127) };
count++;
clear();
moveTo(_xmouse, _ymouse);
for (var i in p) {
lineStyle(p[i].w, p[i].col);
p[i].x += p[i].vx;
p[i].y += p[i].vy;
if (p[i].y > 380) {
p[i].y = 380;
p[i].vy *= -0.5;
p[i].vx *= .95;
}
if (i) curveTo(p[i].x, p[i].y, (Number(p[i].x) + Number(p[i-1].x))/2, (Number(p[i].y) + Number(p[i-1].y))/2);
if (p.length > 50) {
p.splice(0, 1);
count--;
}
}
};
I'd gladly pay you on Thursday
for a hamburger today!