Hatena::ブログ(Diary)

uncertain world

2009-01-22

ActionScriptの練習3

| 00:40 | ActionScriptの練習3を含むブックマーク 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();
	}
}

トラックバック - http://d.hatena.ne.jp/rin1024/20090122/1232638852