Skip to main content
Participant
June 14, 2011
Answered

Total up scores in many scenes

  • June 14, 2011
  • 1 reply
  • 321 views

Hi there.

I'm trying to make a very simple flash game for my college project. The players will get 1 point each time they click on certain object. I've created 3 scenes and each of the scene has score value. I want to total up the score at Scene3. FYI, I use:

1st Action Script add this to the variables frame:

_root.total = 00;

2nd Action Script add this to each of the hit sections in the Action Script frame:

_root.total = Number (total) +1;

My question is, how to add up the scores from Scene 1,2 & 3? What script should I use? Thanks in advance

This topic has been closed for replies.
Correct answer kglad

if you use _root.total in each of your scenes, it will store a running sum.  so, just use:

_root.total

1 reply

kglad
Community Expert
Community Expert
June 14, 2011

_root.total will contain that total.  ie, variables are not local to scenes.

xaty88Author
Participant
June 14, 2011

so, do you have any idea about the script that i should use?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 14, 2011

if you use _root.total in each of your scenes, it will store a running sum.  so, just use:

_root.total