Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Displaying integers

Guest
Jan 20, 2014 Jan 20, 2014

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?

TOPICS
ActionScript
280
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 20, 2014 Jan 20, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 20, 2014 Jan 20, 2014
LATEST

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines