trace ("Welcome to Pong!") ; Game = function () { trace ("New Game created") ; this.timeline = _root ; this.left = 100 ; this.right = 400 ; this.up = 50 ; this.down = 350 ; this.barLevel = 330 ; this.lives = 3 ; } ; Game.prototype.init = function () { trace ("Init method called") ; this.drawArena () ; this.initBar () ; } ; Game.prototype.drawArena = function () { trace ("DrawArea method called") ; var Arena = this.timeline.createEmptyMovieClip ("Arena", 0) ; Arena.lineStyle (0, 0, 100) ; Arena.moveTo (this.left, this.up) ; Arena.lineTo (this.right, this.up) ; Arena.lineTo (this.right, this.down) ; Arena.lineTo (this.left, this.down) ; Arena.lineTo (this.left, this.up) ; } ; Game.prototype.initBar = function () { trace ("InitBar method called") ; bar.StartDrag (true, this.left + bar._width/2, this.barLevel, this.right - bar._width/2, this.barLevel); ball.followBar () ; } ; MovieClip.prototype.followBar = function () { this.onEnterFrame = function () { this._x = bar._x ; this._y = bar._y - this._height / 2 ; } } ; Pong = new Game () ; Pong.init () ;