3

I'm new to flash and I need to make a scoring system where in when you click on a symbol (button) in the stage it will add to the score textbox. I have this simple code:

on(release) { _root.points++; _root.score.text = _root.points; }

that I put on the button and it works fine, the problem is when I click on another button on the stage the score textbox displays the word NAN instead of increasing by one.

Anyone can help me?

Yme Potxpotx
  • 45
  • 1
  • 1
  • 4
  • NaN stands for "Not a Number". It means you've tried to set "points" to a value that is a string type (for example, the word "score"). What code is on the other button? – Hoeloe Dec 14 '12 at 13:54
  • ah thanks for the answer, i've already solved the problem :) – Yme Potxpotx Jan 10 '13 at 03:57

1 Answers1

0

There is nothing wrong with your code... make sure you have the same code in the other buttons... perhaps you spelled a variables wrong when you were setting the .text equal to _root.points; (did you forget to pluralize it? I do that alot haha)

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195