Yes. But I want the styles to apply to marked up text, the htmlText property of TextFields, TextAreas. For example, I can set the styleName of a TextArea to someStyleClass and it's text is styled by that one class.
On Fri, Feb 13, 2009 at 4:49 PM, Teddy R. Payne <[email protected]>wrote: > You mean something like: > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> > > <mx:Style source="../assets/SimpleTypeSelector.css"/> > > <mx:Button id="myButton" label="Click Me"/> > > </mx:Application> > > From: > http://livedocs.adobe.com/flex/3/html/help.html?content=styles_05.html > > > Teddy R. Payne, ACCFD > Google Talk - [email protected] > > > > On Fri, Feb 13, 2009 at 4:44 PM, John Waggener <[email protected]>wrote: > >> When using text in Flex, I commonly create TextAreas, assign marked up >> text (htmlText property) to those areas and then apply a StyleSheet. >> >> I couple of limitations that are frustrating. TextArea doesn't seem to >> resize automatically. This means if I have a couple of TextAreas in the >> flow of a Box, they may not be large enough for the text. If I assign new >> text they do not resize appropriately. I don't find flash's textheight >> calculations reliable. >> >> The flow of text and media. >> I do believe that htmlText can contain an img tag, making it part of the >> flow. But the range of styles is limited. >> >> In general, is there a good way, a best practice, to use marked up text >> and other uicomponents in a flow? Can text wrap a Ui component that is a >> videoplayer? >> >> Also, can I can use an external CSS to style a TextArea with marked up >> text? >> >> I know that i can set styleName to one style definition. But the point is >> to apply any number of styles to any number of tags. >> >> __textArea.styleSheet = someExternalCss; -- ideally a CSS that is applied >> to whole app without explicitly loading. >> >> Any thoughts or pointers to resources are appreciated. >> >> What I'm doing: >> >> private var __info:TextArea; >> private var styles:StyleSheet; >> private var stylesText:String = >> '.h1{ font-family: Arial, Helvetica, Times; font-weight: >> regular; color:#ffffff; font-size:20; }'+ >> '.regular{ font-family: Arial, Helvetica, Times; font-weight: >> regular; color:#ffffff; font-size:14; }'+ >> '.link{ font-family: Arial, Helvetica, Times; font-weight: >> regular; color:#68b8d6; font-size:14; text-decoration:underline; }'; >> >> styles = new StyleSheet(); >> styles.parseCSS(stylesText); >> >> __info = new TextArea(); >> __info.styleSheet = styles; >> >> >> -- >> Johnny Waggener >> Software Developer >> Multicast Media >> 678-592-2650 >> > > -- Johnny Waggener Software Developer Multicast Media 678-592-2650
