-
1. Re: Displaying Changing Variables as Text
crossfireue Jan 16, 2013 12:07 PM (in response to crossfireue)Here's an update...
I've sorted out how to use a call to set a text box's numerical content when it's created, and how to change it on the click of a button. I'm still trying to sort out how to make the script simply add or subtract from a text box's numerical content on the click of a button, instead of physically setting the amount to specific value.
-
2. Re: Displaying Changing Variables as Text
Joe Bowden Jan 17, 2013 12:12 PM (in response to crossfireue)Hi there,
Generally speaking, you want to create a variable with an initial value (setVariable), and then when you click on a button, update the variable value (getVariable, and then increment/decrement it, and then setVariable to this new value), and finally set the text field to the current value of the variable (getVariable).
Does that help? Let me know if an example file would help.
Joe
-
3. Re: Displaying Changing Variables as Text
crossfireue Jan 17, 2013 12:19 PM (in response to Joe Bowden)That is helpful – thanks!
Should the text box that displays the variable (score) be a plain text box (I'm guessing that's an "element") or should I convert it to a symbol and work with that?
Rob.
-
4. Re: Displaying Changing Variables as Text
Joe Bowden Jan 17, 2013 12:25 PM (in response to crossfireue)It should be a text element. It could be within a symbol or not, depending on your needs. If you want it in a symbol, you'll have to use getSymbol to access the text element when you update it.
hth,
Joe
-
5. Re: Displaying Changing Variables as Text
crossfireue Jan 17, 2013 12:34 PM (in response to Joe Bowden)Thanks, Joe. If you have the time to prep an example file, I'd really appreciate it. Thanks so much!
Rob.
-
6. Re: Displaying Changing Variables as Text
Joe Bowden Jan 17, 2013 1:21 PM (in response to crossfireue)Hi Rob,
No problem - look this over: https://dl.dropbox.com/u/109596236/score-keeper.zip
Just ask if you have any questions,
Joe
-
7. Re: Displaying Changing Variables as Text
crossfireue Jan 17, 2013 1:24 PM (in response to Joe Bowden)This is perfect, Joe. Thank you! The rest of this game should be a cakewalk.
Cheers,
Rob.


