Stage.scaleMode = "noScale";
var depths = 1; this.createEmptyMovieClip("dot", 0); this.createEmptyMovieClip("l", -1); with (dot) { lineStyle(1, 0xffffff); lineTo(1, 0); _visible = false; } function drawLine() { for (var i = depths; i<depths+4; i++) { var d = dot.duplicateMovieClip("dot"+i, i, {_x:random(400), _y:random(400), a:0}); line = l.createEmptyMovieClip("line"+i, i); line.clear(); line.lineStyle(1, 0xffffff); line.moveTo(d._x, d._y); d.onEnterFrame = function() { this.a += 5; this.dx = posx-this._x; this.dy = posy-this._y; this.dis = Math.sqrt(this.dx*this.dx+this.dy*this.dy); this.r = Math.atan2(this.dy, this.dx); this._x += this.dx/7-Math.sin(this.r)*this.dis/7*Math.sin(this.a*2); this._y += this.dy/7+Math.cos(this.r)*this.dis/7*Math.sin(this.a*2); this._parent.l["line"+this._name.substr(3)].lineStyle(1, 0xff0000, this.a); this._parent.l["line"+this._name.substr(3)].lineTo(this._x, this._y); if (Math.abs(this._x-posx)<1 and Math.abs(this._y-posy)<1) { this.removeMovieClip(); } }; } } this.onMouseDown = function() { posx = _xmouse; posy = _ymouse; drawLine(); depths = depths>12 ? 1 : depths+4; }; //as区已加分:) |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |