I was thinking if I could pass a value from a variable when I go to a next scene. Like for example, I have Scene 1 and Scene 2. In scene 1, I'm playing a game and ofc, I am having a score. When the character in the game dies, it will go to the second scene. The method I used in going to the second scene is gotoAndStop. How can I pass the score to the second scene so I could show it in the Game over scene(scene2)? Thanks! :))
Asked
Active
Viewed 2,157 times
2 Answers
0
You could define a class to store your score.
package file_as {//this is the package name
public class CScore {
public function CScore() {
public var MyScore:int = 100;
}
}
}
And in the script,you just new it and use it.Like,trace("CScore.MyScore")
;

Panda Young
- 13
- 2