The problem is, i can’t get the mouse to be the same point as the control point. Without the alpha fading, it works, but without, it doesn’t :-\ Very frustrating. hope someone can help! thanks ! :beam:
if you want the mouse to be the same as the control point, then you don’t need that formula to calculate controlx and control y
[AS]
x1 = 100;
y1 = 200;
x2 = 400;
y2 = 200;
_root.onEnterFrame = function() {
_root.createEmptyMovieClip(“line”+i, i);
trace(“controlx=”+controlx);
trace(“mousex=”+_root._xmouse);
controlx = _root._xmouse//*2-(x2-x1)/2;
controly = _root._ymouse//*2-(y2-y1)/2;
_root[“line”+i].lineStyle(2, 0x00FF00, 80);
_root[“line”+i].moveTo(x1, y1);
_root[“line”+i].curveTo(controlx, controly, x2, y2);
alphaFade(_root[“line”+i]);
i++;
if (i>1000) {
i = 0;
}
};
MovieClip.prototype.alphaFade = function(fadingLine) {
fadingLine.onEnterFrame = function() {
fadingLine._alpha -= 10;
if (fadingLine._alpha<=0) {
fadingLine.clear();
}
};
};
now, if you want the mouse to be at the peak of the curve, you would use this.