Dusty Bubble Line

Its a bubling line that blows away in the wind… like dust.


onMouseDown = function () {
    old = new Array(_root._xmouse, _root._ymouse, true, Math.random()*0xFFFFFF, Math.round(5*Math.random()));
};
onMouseUp = function () {
    old = new Array(_root._xmouse, _root._ymouse, false, Math.random()*0xFFFFFF, Math.round(5*Math.random()));
};
onMouseMove = function () {
    if (old[2]) {
        dist = {tot:Math.sqrt(Math.pow(_root._xmouse-old[0], 2)+Math.pow(_root._ymouse-old[1], 2)), x:_root._xmouse-old[0], y:_root._ymouse-old[1], pieces:1, d:_root.getNextHighestDepth(), maxLength:5};
        while (dist.tot>dist.maxLength) {
            dist.pieces++;
            dist.tot -= dist.maxLength;
        }
        for (i=1; i<=dist.pieces; i++) {
            clip = _root.createEmptyMovieClip("clip"+dist.d, dist.d);
            clip._x = old[0];
            clip._y = old[1];
            clip.lineStyle(old[4], old[3], 100);
            clip.lineTo((dist.x/dist.pieces)*i, (dist.y/dist.pieces)*i);
            clip.stats = {age:0, yv:0, xv:0, rv:0};
            clip.onEnterFrame = function() {
                (this.stats.age>40) ? this.stats.yv += .7 : this.stats.age++;
                (this.stats.age>40) ? this.stats.xv += Math.random() : null;
                (this._y>400) ? this.removeMovieClip() : this._y += this.stats.yv;
                (this._x>550) ? this.removeMovieClip() : this._x += this.stats.xv;
            };
        }
        (old[5]) ? old[4] += .3 : old[4] -= .3;
        (old[4] >= 8 || old[4] < 0) ? (old[5]) ? old[5] = false : old[5] = true : null;
        old = new Array(_root._xmouse, _root._ymouse, true, old[3], old[4], old[5]);
    }
};

i love it!