flashactionscript-3flash-cs4action

how do you display a variable in a text field? AS3


I am new to AS3 and I have been creating myself mini-projects to learn and my newest one is to have a variable that counts up.

for (var i = 0; i < 0; i++)
{
    trace (i);
} 

I have a dynamic text field that I am trying to display the variable i in a dynac text field. How would I do this? Thank you in advance.


Solution

  • txtField.text = i.toString();
    

    or

    txtField.text = String(i);