タグ :

ランダム運動2-2 : ActionScript

投稿日 : 2008年2月24日 | 更新日 : 2010年09月15日 前のページへ戻る

前回(ランダム運動2-1)と同じスクリプトです。落下するボールを0と1の数字にしています。
function ParticleClip(target) {

	var target = target;

	this.execMotion = function(x, n) {
		for (var i = 0; i < n; i++){
			var container = target.createEmptyMovieClip("container"+i, i);
			if((i % 2)==0){
				var clip = container.attachMovie("zero", "clip", 0);
			}
			else {
				var clip = container.attachMovie("one", "clip", 0);
			}
			container._x = Math.random()*300;
			container._rotation = Math.random()*2;
			container._y = -100;
			clip.onEnterFrame = function() {
				// Move the particle over time
				this._y += this.speed;
				this.speed++;
				if (this._y>400) {
					this._y = 0;
					this.speed = Math.random()*10+5;
					this._yscale = 100;
				}
			};
			clip.speed = Math.random()*10;
		}
	};
}

var obj = new ParticleClip(_root);
obj.execMotion(0, 100);

関連記事

»ランダム運動3 : ActionScript »ランダム運動2-2 : ActionScript »ランダム運動2-1 : ActionScript »ランダム運動1 : ActionScript

ActionScript2.0 | 固定リンク | Comments (1)

関連記事

このページの上へ移動

コメント


  1. I’m impresesd. You’ve really raised the bar with that.

    コメント by Rosa — 2011年12月14日 @ 5:39 PM

コメントの投稿

改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。

 

 

 


トラックバックURL

http://www.findxfine.com/flash/actionscript/130.html/trackback

このページの上へ