Hi guys,
I made a mouse trail effect with the following code.
i=0
onMouseMove = function () {
var cur_x = _xmouse;
var cur_y = _ymouse;
var limit = 3;
var min = 10;
var max = 60;
var alfa = 160;
var delta_x = old_x-cur_x;
var delta_y = old_y-cur_y;
var dist = Math.sqrt(delta_xdelta_x+delta_ydelta_y);
old_x = cur_x;
old_y = cur_y;
if (dist>limit) {
i++;
attachMovie(“stars”, “stars”+i,-510+i);
with (this[“stars”+i]) {
var ran = Math.random()*max+min;
var ran2 = Math.random()*alfa-alfa/2;
_rotation = ran2;
_xscale = _yscale=ran;
_x = _parent._xmouse;
_y = _parent._ymouse;
}
}
};
Now i saved the movie named stars.swf.
In another movie named main.swf i load the stars.swf in a movie clip container named mc_ContainerStars.
Ok thinking the stars.swf wil only load itself and work within the container.
It played itself over the whole main.swf. So i devined the _height and _weight of the container. Hoping the mousetrail would only play within these constrains. But it didn’t! It played itself over the whole main.swf.
Any tips suggestions would be nice.
Thanks in advance! Sorry for my english