/ Published in: Other
Expand |
Embed | Plain Text
/* このスクリプトは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();
You need to login to post a comment.
