this._x = (this._y=200);
for (var i = 0; i<30; i++) {
mcp = this.createEmptyMovieClip("mc"+i, i);
//每个mc中定义一个方法
this["mc"+i].newHeading = function() {
this._x = 200-random(400);
this._y = 50-random(100);
this._alpha = 50+random(50);
this.xv = ((.5-Math.random())*5)%5;
this.yv = ((.5-Math.random())*5)%5;
this.av = ((.5-Math.random())*5);
};
this["mc"+i].newHeading();
this["mc"+i].onEnterFrame = function() {
(this._x<=-200 || this._x>=200) ? (this.xv=-this.xv) : (this.xv+Math.random()*5);
this._x += this.xv;
(this._y<=-50 || this._y>=50) ? (this.yv=-this.yv) : (this.yv+Math.random()*5);
this._y += this.yv;
};
this["mc"+i].c = random(40)+5;
for (var j = 5; j>0; j--) {
this["mc"+i].lineStyle(j*4, 0x005544, 20-j*2);
this["mc"+i].lineTo(j%5, 0);
}
}
for (var i = 0; i<30; i++) {
mcp = this.createEmptyMovieClip("mc"+i, i);
//每个mc中定义一个方法
this["mc"+i].newHeading = function() {
this._x = 200-random(400);
this._y = 50-random(100);
this._alpha = 50+random(50);
this.xv = ((.5-Math.random())*5)%5;
this.yv = ((.5-Math.random())*5)%5;
this.av = ((.5-Math.random())*5);
};
this["mc"+i].newHeading();
this["mc"+i].onEnterFrame = function() {
(this._x<=-200 || this._x>=200) ? (this.xv=-this.xv) : (this.xv+Math.random()*5);
this._x += this.xv;
(this._y<=-50 || this._y>=50) ? (this.yv=-this.yv) : (this.yv+Math.random()*5);
this._y += this.yv;
};
this["mc"+i].c = random(40)+5;
for (var j = 5; j>0; j--) {
this["mc"+i].lineStyle(j*4, 0x005544, 20-j*2);
this["mc"+i].lineTo(j%5, 0);
}
}
回复Comments
作者:
{commentrecontent}