putting variables value into .text
How can I input varables value into a textfield?
var i:uint=0
for(i; i<4; i++){
pageText.text=i+1
}
If i use i+"something" then it 开发者_如何学运维can get the i value, but other than that it could not get i value.
The text property of TextField is expecting a string. Use toString to convert the int.
var i:uint=0
for(i; i<4; i++){
pageText.text=i.toString();
}
Try:
var pageText:TextField = new TextField();
var i:uint=0
this.addchild(pageText)
for(i; i<4; i++)
{
pageText.text=i
}
精彩评论