var p = Math.PI*2; var a = [0, p / 4, 0, p / 4, 0, p / 4, 0, p / 4, p / 8];//人各个部位的弧度 var b = [400, 400, 450, 450, 450, 450, 300, 200, 175]; var c = [20, 20, 20, 20, 40, 40, 60, 80, 20];//椭圆的y坐标和截距 var num = 9;//部位的数目,如要更多,自己添加 var i = 0; while (i < num) { ball.duplicateMovieClip("ball" + i, i); this["ball" + i].i = i; i++; } ball8._xscale = (ball8._yscale = 200);//头部放大 //下面为连线,组成一个人 onEnterFrame = function () { createEmptyMovieClip("line", 2000); with (line) { lineStyle(8, 0, 100); var i = 0; while (i <= 1) { moveTo(ball._x, ball._y); lineTo(this["ball" + i]._x, this["ball" + i]._y); i++; } var i = 0; while (i <= 3) { moveTo(this["ball" + i]._x, this["ball" + i]._y); lineTo(this["ball" + (i + 2)]._x, this["ball" + (i + 2)]._y); i++; } var i = 6; while (i <= 7) { moveTo(body._x, body._y); lineTo(this["ball" + i]._x, this["ball" + i]._y); i++; } } };
3、选中头部,加上
onClipEvent (load) { var myMove = new Move (150, 300, 20, 2, 0); var i; if (this._name != "ball" { myMove.timer(_parent.a); myMove.cen_y(_parent.b); myMove.cen_a(_parent.c); } else { myMove.cen_a(0); myMove.cen_b(0); } if (this._name != "ball8" { this._visible = 0; } } onClipEvent (enterFrame) { myMove.myMove(this); }