We are practically done now! All we have left to do is the variable initiation in Frame 1, so go to frame 1, and insert the following actionscript there.
delay = 6; //set to 6 instead of 30 to prevent a long delay upon loading the flash program.
ballsOnScreen = new Array();
boxesOnScreen = new Array();
numBalls = 0;
numBoxes = 0;
x = 1;