dynamic text colour change

By teamchuck | Jan 12, 2009

actionscript3

Using this code I am filling a dynamic text box with numbers 1-number defined by xml:

Code:

var pageNum:String;
txt.text = "";
for (var i:int=1; i < myXML.*.length()+1; i++) {
        pageNum = String(i);
        txt.appendText(pageNum+"  ");
}


What I would like to do is be able to change the colour of one number. If the dynamic text box has the numbers 1-5 in it I would, for example, like to change the colour of the number 2. Have it set to blue but the rest to white. How would I do this without changing the colour of the entire text field?

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0