title: flash game development AS3
body: <p>I am developing a game in flash AS3 in which multiple items are falling down and have to be caught it at the bottom using the mouse.</p>
  
  <p>just want to brief you regarding the game.</p>
  
  <p>This is the link for similar game  : <a href="http://www.playitontheweb.com/games/Catch-Falling-Fruit-game.htm" rel="nofollow">http://www.playitontheweb.com/games/Catch-Falling-Fruit-game.htm</a></p>
  
  <pre><code>At frame 1 &gt; Preloader
  At frame 2 &gt; Game front page.
  At frame 3 &gt; Game introduction.
  At frame 4 &gt; user will b playing the game.
  At frame 5 &gt; Final Score. 
  </code></pre>
  
  <p>This is what i want to make it in functionality wise.</p>
  
  <p>Here is the script script(AS3) which plays the game in all frames. From 1 to 5 which i dont want: Please help......</p>
  
  <pre><code>package {
  import flash.display.*;
  import flash.events.*;
  import flash.text.*;
  import flash.utils.Timer;
  import flash.utils.getDefinitionByName;
  
  public class CatchingGame extends MovieClip {
      var catcher:Catcher;
      var nextObject:Timer;
      var objects:Array = new Array();
      var score:int = 0;
      const speed:Number = 7.0;
  
      public function CatchingGame() {
          catcher = new Catcher();
          catcher.y = 350;
          addChild(catcher);
          setNextObject();
          addEventListener(Event.ENTER_FRAME, moveObjects);
      }
  
      public function setNextObject() {
          nextObject = new Timer(1000+Math.random()*1000,1);
          nextObject.addEventListener(TimerEvent.TIMER_COMPLETE,newObject);
          nextObject.start();
      }
  
      public function newObject(e:Event) {
          var goodObjects:Array = ["Circle1","Circle2"];
          var badObjects:Array = ["Square1","Square2"];
          if (Math.random() &lt; .5) {
              var r:int = Math.floor(Math.random()*goodObjects.length);
              var classRef:Class = getDefinitionByName(goodObjects[r]) as Class;
              var newObject:MovieClip = new classRef(); 
              newObject.typestr = "good";
          } else {
              r = Math.floor(Math.random()*badObjects.length);
              classRef = getDefinitionByName(badObjects[r]) as Class;
              newObject = new classRef(); 
              newObject.typestr = "bad";
          }
          newObject.x = Math.random()*500;
          addChild(newObject);
          objects.push(newObject);
          setNextObject();
      }
  
      public function moveObjects(e:Event) {
          for(var i:int=objects.length-1;i&gt;=0;i--) {
              objects[i].y += speed;
              if (objects[i].y &gt; 400) {
                  removeChild(objects[i]);
                  objects.splice(i,1);
              }
              if (objects[i].hitTestObject(catcher)) {
                  if (objects[i].typestr == "good") {
                      score += 5;
                  } else {
                      score -= 1;
                  }
                  if (score &lt; 0) score = 0;
                  scoreDisplay.text = "Score: "+score;
                  removeChild(objects[i]);
                  objects.splice(i,1);
              }
          }
  
          catcher.x = mouseX;
  
      }
  }
  }
  </code></pre>
  
  <p>Also would like to ask you can we add a timer in that of 60 sec?
  as soon as the timer gets over it goes to the last frame to shaw the final score.</p>