![]() |
![]() |
||||||
|
|||||||
| Tags: css, stylename |
![]() |
|
|||
|
we have a flex project with many html UITextFields. The issue is getting the
style correct. At preset, text fields are getting their styles from class attributes. For example, if we have an XMLList like this: <p class='norm'> This is <a href='event:do something'>Test</a></p> the text field is assigned a styleName of .norm from our application css. I have tried to rather assign a styleSheet to the UITextFields, but the only way i can get fonts to embed is if i use the application's css which gets fonts from a swf: @font-face { src:url('fnt/Fonts.swf'); font-family:'font1'; } So, while styleName embeded the fonts well, the problem is getting things like the anchor to cooperate, and worse, lists ([LI] tags) At times, we have multiple paragraphs and/or lists all in one html UITextField. We need to apply more than just one styleName to the fields. However, as i said, if we try to assign a styleSheet to the text field we get empty textFields. It seems the only way to get any formatting is by using styleName. I am aware we could litter our markup with <font face='font1' color='#ffffbb'> but that seems a bit of a hack. Can someone give some direction of how to use css, styleNames, and or both to a UITextField? Attached is my method for creating the textfield and yes, i have scoured forums and help files. thanks private function doTexts(layout_txts:XMLList,content_xml:XMLList):v oid { for(var i:int=0;i<page_content.text_copy.length();i++) { var eachElm:XML=layout_txts[i] as XML; var id:String=eachElm.@id as String; var _x:Number=eachElm.x ; var _y:Number=eachElm.y ; var _w:Number=eachElm.width; var _h:Number=eachElm.height; var tf:UITextField= new UITextField(); var style_name:String=page_content.text_copy[i].children().attribute('class'); if(style_name=="") { style_name='norm'; } with(tf) { styleName=style_name.toString(); autoSize=TextFieldAutoSize.LEFT; if(_x != undefined) x=_x; if(_y != undefined) y=_y; wordWrap=true; mulitline=true; embedFonts=true; if(_w != undefined) width=_w; if(_h != undefined) height=_h; selectable=true; } var vs:XMLList=page_content.text_copy[i].children().(namespace()); tf.htmlText=cleanHTML(vs); addChild(tf); var txmetrx:TxMetrx= new TxMetrx(); var wordObjects:Array=getWordObjects(); txmetrx.addTargetWords(wordObjects); txmetrx.addTextField(tf) txmetrx.place=tfmc; txmetrx.addEventListener(TxMetrxEvent.MOUSE_OVER,w ordFoundEvent_OVER) txmetrx.addEventListener(TxMetrxEvent.MOUSE_OUT,wo rdFoundEvent_OFF) } } |
| Sponsored Links |
|
|||
|
Adobe Newsbot hopes that the following resources helps you. NewsBot is experimental and any feedback (reply to this post) on its utility will be appreciated:
All Classes (Flex Gumbo): mx.rpc.xml, Encodes an ActionScript object graph to XML based on an XML schema. ...... Please submit feedback to the open-source Flex SDK Forum Link: http://livedocs.adobe.com/flex/gumbo...s-summary.html Disclaimer: This response is generated automatically by the Adobe NewsBot based on Adobe [L=Community Engine]http://community.adobe.com/ion/search.html[/L]. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise