function drawCurve() { with (room) { clear(); var i = 0; while ((++i)<=c) { var mc = room["mc"+i]; var cx = (mc._x+mc.px)/2; var cy=(mc._y+mc.py)/2; var ccx = (mc._x-mc.px)/2; lineStyle(3, "0xFFCC00", 100); moveTo(mc._x, mc._y); curveTo(cx+ccx, cy, cx, cy); curveTo(cx-ccx, cy, mc.px, mc.py); } } } //////////////////////////////////////////// _level0.createEmptyMovieClip("room", 10); c=10; var i = 0; while ((++i)<=c) { var ball = room.attachMovie("mc", "mc"+i, i); if (room["mc"+(i-1)]._x == undefined) { prev = 0; } else { prev = room["mc"+(i-1)]._x; } ball._rotation=random(360); ball._xscale=ball._yscale=70+random(30); ball.sx=ball._x = prev+500/c/2+random(500/c/2); ball.sy=ball._y = random(100)+100; ball.px = ball._x+50-random(100); ball.py = 400; ball.tx = ball._x+100-random(200); ball.ty = ball._y+100-random(200); ball.onEnterFrame = function() { this._x += (this.tx-this._x)*.1; this._y += (this.ty-this._y)*.1; if (int(this.tx-this._x) == 0 && int(this.ty-this._y) == 0) { this.tx = this.sx+100-random(200); this.ty = this.sy+100-random(200); } }; } setInterval(drawCurve, 20); |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |