1 Reply Latest reply on May 2, 2013 4:00 PM by Sean_Wilson

    Game Score

    DirBuddy12 Level 1

      I am trying to make a game score by inserting a value to the text field when each sprite is clicked by the mouse.

      My code looks like as follows:

       

      on mouseDown me

       

        member("Score Tally").text = integer("Score Tally")

        lvCurrentScore = lvCurrentScore + 100

        lvCurrentScore = ("Score Tally")

       

      end

       

      It doesn't provide me with any errors when I compile it but when I click the sprite it places null in the text field.

      Any help would be greatly appreciated thank you.

        • 1. Re: Game Score
          Sean_Wilson Adobe Community Professional

          It's difficult to understand from your code what "Score Tally" is, but assuming it's a member name the following might help:

          on mouseDown me
            lvCurrentScore = integer( member("Score Tally").text )
            lvCurrentScore = lvCurrentScore + 100
            member("Score Tally").text = string(lvCurrentScore)
          end