Copy link to clipboard
Copied
I am new to flash and I have a question that's kinda newbie..
I have a variable integer called "score" I want to display it in another scene. Let's say I type var score:int = 0 and I pick up 5 coins (every coin up the value of score by 1) so my score is 5. Then i progress to the next scene and i want to display the value of score. How do I do that?
Copy link to clipboard
Copied
I recommend avoiding the use of scenes and just develop along the one timeline either by using different sections of it for the different scenes you want or different movieclips that you control the visibility of. Then as long as you have the layer where you declared the score extended the length of the timeline you can assign/read its value any time.
Copy link to clipboard
Copied
steps:
1. Create a text box type, dynamic text.
2. An instance name for the box, eg "displayResult".
3. Copy and paste this text box where you want the result to appear.
4. In actionscript code vc presents the results as follows:
var total: int = 15;
displayResult.text = String (total);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now