5 Replies Latest reply on Apr 24, 2008 12:34 PM by kglad

    Function malfunction

    inliten
      Hi,

      New to ActionScript (using 2.0). Trying to set timer for movie and increment three different dynamic text boxes with mouse click action. Have looked and tried many different arrangements and code variations - unsuccessfully.
      The timer does not work - for brevity sake I set it to 10 seconds - does not count down.
      The dynamic text boxes for segments 2 and 3 do not increment - keep score of mouse "hits".
      Any suggestions or help is greatly appreciated at this point.
        • 1. Re: Function malfunction
          kglad Adobe Community Professional & MVP
          what are you trying to accomplish?
          • 2. Re: Function malfunction
            inliten Level 1
            Thanks,
            A simple game: Like the old arcade's "Whack-a-Mole" with 9 "tubes" with objects randomly ascending and descending in each tube. The first three tubes on the left are dedicated to one object, the three middle tubes to a second object, and three right tubes to a third object. The user employs the mouse to "strike" any ascending object (at frame 10 of 20 frames) to score a "hit". I want a timer limit on the game, hence the timer function/variable and I want the strikes to be counted and incremented into the respective dynamic text boxes. The dynamic text boxes are named for the score display (hc_txt.text, jm_txt.text, bo_txt.text) the objects are distinctly named (h0, j1, o2, h3, j4, o5, h6, j7, o8).
            So what I am trying to do is have the "scores" (hits) counted and posted to the owner dynamic text boxes and the timer function wind down and end the game.
            Hope this is clear and thank you for the interest.
            • 3. Re: Function malfunction
              kglad Adobe Community Professional & MVP
              for you countdown timer use setInterval().

              for your scoring you should be using a hitTest() in a mouseDown listener.
              • 4. Re: Function malfunction
                inliten Level 1
                Thank you very much for the information.
                • 5. Re: Function malfunction
                  kglad Adobe Community Professional & MVP
                  you're welcome.