Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT BASED ON THE ASKERS FEEDBACK: I didn't realize you wanted to just apply one style to the whole textfield, I thought you wanted to style individual parts. This is even simpler for you, won't give you any trouble at all :)</p> <pre><code> var textFormat: TextFormat = new TextFormat("Arial", 12, 0xFF0000); myText.setTextFormat(textFormat); </code></pre> <p>Be aware that this sets the style to the text that is in the TextField, not necessarily future text you put in. So have your text in the field before you call setTextFormat, and set it again every time you change it just to be sure it stays.</p> <p>It's probably best if you use a normal TextField as opposed to the component. If you still want the component you may need to call textArea.validateNow() to get it to update with the new style (not 100% sure on that one though) Adobe components are notoriously bad, and should be avoided. :(</p> <p>To see all available options on the TextFormat object see <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html" rel="nofollow noreferrer">here</a></p> <p>END EDIT ---------</p> <p>This is easy enough to just do with CSS in a normal old TextField.</p> <pre><code> var myCSS: String = "Have some CSS here, probably from a loaded file"; var myHTML: String = "Have your HTML text here, and have it use the CSS styles"; // assuming your textfield's name is myText var styleSheet: StyleSheet = new StyleSheet(); styleSheet.parseCSS(myCSS); myText.autoSize = TextFieldAutoSize.LEFT; myText.styleSheet = styleSheet; myText.htmlText = myHTML; </code></pre> <p>Supported HTML tags can be found <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#htmlText" rel="nofollow noreferrer">here</a> <br/>Supported CSS can be found <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html" rel="nofollow noreferrer">here</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload