PDA

View Full Version : Changing Text Appreance


stocktonlad
12-27-2007, 04:02 PM
I've got a dynamic text box on my frame with text in it. My text box has a var name of "txtText"

I want to be able the user to click a button and the text will change size, font style, colour etc.

I am really struggling with setTextFormat(), set NewTextFormat and new TextFormat();

Any ideas.

Cheers

John

Nomad2000
12-27-2007, 07:19 PM
In your button's click handler function, just do something like this:

// Create a Courier font, 20pt, red color and bold (true)
// See the help files for TextFormat for other options.
var textFormat:TextFormat = new TextFormat("Courier", 20, 0xFF0000, true);

// Apply the TextFormat we just created to the myTextField object
myTextField.setTextFormat(textFormat);