## Posted By

daisuke103 on 02/14/08

# AS2 ãƒ¬ãƒ³ã‚ºãƒ•ã‚£ãƒ«ã‚¿ãƒ¼ã®ã‚ˆã†ã«ç”»åƒã‚’æ‹¡å¤§ã—ã¦ç§»å‹•ã™ã‚‹

/ Published in: Other

`/*ã“ã®ã‚¹ã‚¯ãƒªãƒ—ãƒˆã¯attachã•ã‚Œã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã«æ›¸ãã“ã‚Œä»¥å¤–ã« ID: ins_Lenzã®90pxã®æ­£å††ã§å†™çœŸ(pic)ã‚’ãƒžã‚¹ã‚¯ã—ãŸãƒªãƒ³ã‚±ãƒ¼ã‚¸ã‚·ãƒ³ãƒœãƒ«ã‚’ä½œæˆ*/ num = 15;zr = 10;vx = 5;vy = 3;ballD = 150;boundary = [20, 20, 620, 360];R = ballD/2;boundary[0] += R;boundary[1] += R;boundary[2] -= R;boundary[3] -= R;scaleA = [];scaleB = []; // å†…å´ã«è¡Œãã»ã©æ‹¡å¤§ã—ãŸå†™çœŸã‚’ãƒžã‚¹ã‚¯ã—ã¦ã„ã‚‹for (i=1; i<=num; i++) {	scaleA[i] = 10+90*(num+1-i)/num;	scaleB[i] = 100+zr*i;	this.attachMovie("ins_Lenz", "lenz_"+i, i);	this["lenz_"+i]._xscale = this["lenz_"+i]._yscale=scaleA[i];	this["lenz_"+i].pic._xscale = this["lenz_"+i].pic._yscale=100*scaleB[i]/scaleA[i];}//function f_ballMove() {	this._x+vx;	if (this._x+vx>boundary[2]) {		this._x = boundary[2];		vx *= -1;	} else if (this._x+vx<boundary[0]) {		this._x = boundary[0];		vx *= -1;	} else {		this._x += vx;	}	if (this._y+vy>boundary[3]) {		this._y = boundary[3];		vy *= -1;	} else if (this._y+vy<boundary[1]) {		this._y = boundary[1];		vy *= -1;	} else {		this._y += vy;	}	for (i=1; i<=num; i++) {		this["lenz_"+i].pic._y = -1*scaleB[i]/scaleA[i]*this._y;		this["lenz_"+i].pic._x = -1*scaleB[i]/scaleA[i]*this._x;	}}f_ballMove(); `