开发者

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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜