createLabel & HTML Text Format Bustin’

If your component inherits from UIObject/UIComponent (one of the 2), and you utilize the createLabel command, the text field can then respond to style changes (CSS based).

Since I use createTextField all over the place in my components, createLabel is nice. Basically, it’s the same as createTextField, but adds all the style info and power it needs to respond to setStyle changes (globally, class, or instance based). It’s kind of weird in that it immediately turns your text field’s _visible property to false, but other than that, it does all the CSS integration for you.

One problem I just found, though, is if you stuff it full of HTML text after you create it (I believe a frame after), the HTML will overwrite the formatting since with html textfields you can format with HTML formatting (whoa…).

Not sure the “correct” way to be formatting my HTML, I guess via getStyle, and dupe a stylesheet, and then apply it, but in the interim, I just immediately call setStyle after I set it’s htmlText property, and the formatting (font) is good again.