Strike Force Heroes 2
The explosive sequel to the hit game Strike Force Heroes!
3.95 / 5.00 11,234 ViewsObsolescence
Defeat the enormous mechanical beasts--and become one of them.
4.03 / 5.00 49,550 ViewsRight this seems really simple and silly but I've had a look at tutorials and can't seem to manage this, in essence all I want to do is make a dynamic text box show a numerical variable on the stage.
So I've made a dynamic text box with the instance name of:
myTextBox
Then I've added this code in the frame:
var textBoxValue:int = 5;
textBox.text = (textBoxValue);
So I'm guessing "text" isn't the right property to use? How do you do it?
You just need to cast your variable as a string:
textBox.text = String(textBoxValue); At 1/27/11 03:39 PM, ChilliTree wrote: Right this seems really simple and silly but I've had a look at tutorials and can't seem to manage this, in essence all I want to do is make a dynamic text box show a numerical variable on the stage.
So I've made a dynamic text box with the instance name of:
myTextBox
Then I've added this code in the frame:
var textBoxValue:int = 5;
textBox.text = (textBoxValue);
So I'm guessing "text" isn't the right property to use? How do you do it?
You're on the right track. The property "text" is the right property to use.
The problem is that "textBoxValue" is an int and that textBox.text is a string and you can't directly convert an int to a string. You'll have to do this:
textBox.text = textBoxValue.toString();
Ah thanks guys, one step at a time ;P