2 Replies Latest reply on Aug 28, 2007 10:53 AM by Mordred58

    number increment trouble

    Mordred58
      I'm using Flash 8 -- Actionscript 2.0
      I've created a quiz that i want to keep track of the user score. i've created a function that, whenever the learner clicks to check the answer of his/her question, checks the correct answer versus what the person picked. I've created a function to play a movie correct movie clip or incorrect movie clip depending on the situation. i've also tried to add one to the user score each time theperson is right, but so far, i'm only getting the first addition, and nothing since (my trace result keeps coming back as 1...) can someone show me where i'm going wrong?
        • 1. Re: number increment trouble
          Greg Dove Level 4
          Does the timeline have more than one frame, perhaps with a gotoAndStop or gotoAndPlay back to this frame with this code. If so, perhaps its resetting userScore back to zero each time that happens.

          e.g. if you have this on frame 1:
          var userScore:Number;
          userScore = 0;

          trace(userScore)
          userScore++

          and this on frame 2:
          gotoAndPlay(1)

          then you will never see a trace of 1 because its being reset to zero each time.

          • 2. Re: number increment trouble
            Mordred58 Level 1
            yes, there is more than one frame in the main timeline. that is probably what's happening, is that it's being reset to 0 each time....