Goal Keeping game will be due on or before Wednesday, March 7th. Send the URL to jacobson@cs.uni.edu.

Flash Action Script 3.0 tutorial on keyboard events (two pages long).

Using the Arrow Keys: http://www.uni.edu/jacobson/s/arrowKeys.html.

The Goal Keeping game example: StopThemMarch31st.html

Detecting a Goalkeeper STOP is as simple as using hitTestObject() method.


See and login to http://lynda.uni.edu to study Flash and/or ActionScript 3.0 basics.


 1.  How do you generate random numbers in Flash ActionScript?
     var dx:int;
     var dy:int;
     dx = Math.random() * 12 - 6;
     dy = Math.random() * 20 + 5;   
     The dx means change in x or difference in x.

     The dy means change in y or difference in y.

     The dx and the dy will be added to the ball.x and ball.y values
     to make the ball move down the Flash stage.

     If dx is -6 or -3 or -1 the ball will angle toward the left.
     If dx is near or at 0, the ball will drop straight down the stage.
     If dx is 2 or 4 or 5 or 6 the ball will angle off toward the right.

     If dy is 5, the ball will move very slowly.
     If dy is near 25, the ball will move very fast from top to bottom.

     if (ball.y > 400) 
         the ball has dropped off the bottom of the stage and
         the goalkeeper did NOT block it or stop it using the
         a s d w keys to move the goalkeeper.

         WHAT do you want to do when this happens?
         Decide very clearly WHAT you want to do.  
         Only after deciding WHAT do you engage in asking and trying
         to figure out HOW.