Flash
init();
function init(){ right = 500; left = 50; top=50; bottom=450; ball_mc.velX=25; ball_mc.velY=25; ball_mc.onEnterFrame=move; } function move(){ this._x+=this.velX; this._y+=this.velY; if (this._x >= right || this._x<=left) { this.velX*=-1; } if (this._y >= bottom || this._y<=top) { this.velY*=-1; } } |