ActionScriptの練習3

今日は流れ星!
なんかコピペになってるきがするけど気にしないw
見せかたについての勉強なんだよ!きっと!


・レイヤー側


var id = 1;
var hoshiObserver = setInterval(function() {
for (i=0;i<=2;i++)
star0.duplicateMovieClip('star'+(++id), id, {_y:0});
if (id >= 200)
clearInterval(hoshiObserver);
}, 500);

・おほし様側(star0)


onClipEvent(load) {
frame = 0;
this._x = Math.random() * Stage.width;
this._y = Math.random() * Stage.height;
this._alpha = 50 + Math.random() * 20;
this._xscale = this._yscale = 50 + Math.random() * 50;
//trace('create '+this._name);
}

onClipEvent(enterFrame) {
if (++frame < 10) {
this._x-=10;
this._y+=5;
this._alpha-=5;
}
else {
this._alpha=0;
//this.removeMovieClip();
}
}