COMP 1671 , Fall 2006

LAB 7

  1. Time to add some love to a gargoyles life. Write code to do roughly the same as found in: heartRain.html

    Hint: create about 100 instances of the hearts and set them moving down. When a heart object goes off the bottom reset it to just above the top screen so it rains down again. I added a drift towards the right, so when they go off the right I move them to just left of the stage. Also note there is some randomness in them so the hearts are not all moving in sync.

  2. Write a progam that reads in N numbers from the user, stores the N numbers in an array, and then print out the sum and average of the numbers. The number N is input by the user and then the program keeps reading in numbers and storing them in an array until all N numbers have been entered. Once all N numbers have been entered print out the sum and average. Hint: your program should have three phases, and hence needs gotoAndPlay() calls. Phase 1: ask how many numbers the user wants to enter. Phase 2: create an array of size N, then use a button and input box to keep entering numbers and storing them in subsequent array elements until all N have been entered and stored. Then, goto phase 3 and calculate and print out the sum and average. Example: lab7b.html
  3. Write a program which plays MovieClip Freeze Tag. One MovieClip object is "it". The other MovieClips on the Stage are "free" until touched by the the MovieClip that is "it". Once a "free" MovieClip is touched it is "frozen" and should stop moving. When all of the "free" MovieClips are touched the animation should end. Example: RedBall.html
  4. Continuation of the preceeding example. Allow the frozen MovieClips to move again if they are touched by a "free" MovieClip. Example: RedBallTwo.html