views:

23

answers:

2

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.

A: 

Try:

var pageText:TextField = new TextField();
var i:uint=0
this.addchild(pageText)

for(i; i<4; i++)
{
    pageText.text=i
}
lugte098
A: 

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();
}
knuckfubuck