# Little code problem i can't figure out

**URL:** <https://forum.kirupa.com/t/little-code-problem-i-cant-figure-out/93845>\
**Category:** Uncategorized\
**Created:** [November 5, 2003, 12:46pm UTC](https://forum.kirupa.com/t/little-code-problem-i-cant-figure-out/93845 "2003-11-05T12:46:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blah\_de\_blah](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@blah\_de\_blah](https://forum.kirupa.com/u/blah_de_blah)\
**Post date:** [November 5, 2003, 12:46pm UTC](https://forum.kirupa.com/t/little-code-problem-i-cant-figure-out/93845/1 "2003-11-05T12:46:34Z")

</div>

Ok so this is the code i made, and everything is working well except for 1 thing ☹ Heres the code (copy and past it to flash to see what it does)…

[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();  
}  
};  
};  
[/AS]

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:
