[DBarbarian Entry 2] - Electricity

Another one.

for (i=1;i<5;i++) {
	(i<3) ? (this.createEmptyMovieClip("e"+i,i)):(this.createEmptyMovieClip("e"+i,i));
	this["e"+i]._x = this["e"+i]._y = 250;	
}

this.pA = new Array();

this.createP = function(x,y,s,d) {
	this.createEmptyMovieClip("p"+(d+20),d+20)._x = x;
	this["p"+(d+20)]._y = y;
	this["p"+(d+20)].lineStyle(s,"0xEBAEFF",100);
	this["p"+(d+20)].lineTo(1,0);
	return this["p"+(d+20)];
}

this.onEnterFrame = function() {
	var dist = Math.sqrt((this._xmouse-250)*(this._xmouse-250)+(this._ymouse-250)*(this._ymouse-250));
	for (i=4;i>0;i--) {
		this["e"+i].clear();
		(i<3) ? this["e"+i].lineStyle(random(10)+10,"0xCC33FF",100):this["e"+i].lineStyle(random(8)+2,"0xFFFFFF",100);
		for (d=random(30)+1;d<=dist and i<3;d+=random(130)+90) {
			this["e"+i]._rotation = this["e"+(i+2)]._rotation = Math.atan2((this._ymouse-250),(this._xmouse-250))*180/Math.PI;
			this["e"+i].lineTo(d,this["e"+i].amp=random(dist/8)-dist/16);
			this["e"+(i+2)].lineTo(d,this["e"+i].amp);
			this.e1.localToGlobal(this.point = {x:d,y:this["e"+i].amp});
			(random(8)==0) ? (this.pA.push([this.createP(this.point.x,this.point.y,random(2)+1,this.depth++),Math.random()*10-5,Math.random()*10-5])):0;
		}
		(i<3) ? this["e"+i].lineTo(dist,0) & this["e"+(i+2)].lineTo(dist,0):0;
	}
	for(i in this.pA) {
		this.pA*[0]._x += this.pA*[1];
		this.pA*[0]._y += this.pA*[2];
		this.pA*[0]._xscale = this.pA*[0]._yscale = 100+random(200)-100;
		(this.pA*[0]._alpha<=0) ? (this.pA*[0].removeMovieClip & this.pA.splice(i,1)):this.pA*[0]._alpha-=(random(5)+2);
	}
}

http://dounanthebarb.tripod.com/Kirupa25LineContest/cdb25LineEntry2Electric.html