Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable?

Status
Not open for further replies.

technokid200

Technical User
Feb 19, 2003
1
US
I have my movie set up so it has about 8 scenes. I have a button on a scene, and the button adds 1 to a textbox(is this a variable?) so the answer = 2. Is there a way to keep this (variable??) when I swich scenes? But, I want the (variable??) to stay the same(1) if the button is not clicked.


Example- To go to scene 5 you have to click on a button which is on scene 3. When this button, button 1, is clicked it brings you to scene 5. On scene 5 there is a textbox with the number 1 in it, it is a dynamic textbox. When you click on button 2 it adds 1 to the textbox, so the textbox now says 2. Now I have this same textbox on scene 3. Button 3 goes back to scene 3. But when i go back to scene 3 the textbox only says 1. If I go back to scene 5 the textbox says 1 too. Any way I can make it so that if you go from scene 3 to scene 5 the textbox(variable??) will stay at 2, but only if button 2 is clicked.

Thanks a bunch on this one guys!
 
sounds like you are just going to need to use a number of variables to track your movement, perhaps an array would work best.... Use of scenes is really only for the authoring environment as they are removed when the movie is published... so you should not have an issue losing variables from scene to scene if you are using them correctly... best way to avoid any confusion would be to not use different scenes, just one scene
 
give the textfield an instance name, mycounter say

add to main timeline first frame

_global.mycount = 1;// or zero
_global.mycounter.text = mycount;

and to the buttons where you want the count incremented

_global.mycount +=1;

i feel the above ought to work but i have not tested it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top