Specify Styles for HTML in a TextField : TextInput Style « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » TextInput StyleScreenshots 
Specify Styles for HTML in a TextField
Specify Styles for HTML in a TextField
             

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="1000" height="800" creationComplete="createStyle()">
    <mx:Script>
        
            private var styleText:String = '.largered {  font-family:Arial, Helvetica;font-size:16; color: #ff0000; }' +
                    '.smallblue font-size: 11; color: #0000ff; font-family:Times NewRoman, Times; }';

            [Bindable]
            private var lipsum:String = "<span class='largered'>Large</span>"+
                " <span class='smallblue'>small</span>";

            [Bindable]
            private var style:StyleSheet;

            private function createStyle():void
            {
                style = new StyleSheet();
                style.parseCSS(styleText);
                text.styleSheet = style;
                text.htmlText = lipsum;
            }

      
    </mx:Script>
    <mx:TextArea id="text" width="200" height="300"/>
</mx:Application>
    
    

   
    
    
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Set width for TextInputSet width for TextInput
2.Set style from the value in TextInputSet style from the value in TextInput
3.TextInput Disabled ColorsTextInput Disabled Colors
4.Using getStyle() and setStyle() methods to change the Button's fontSize style and display the new size in the TextInputUsing getStyle() and setStyle() methods to change the Button's fontSize style and display the new size in the TextInput
5.Add Move effect to TextInputAdd Move effect to TextInput
w__w__w._j___a_va_2s_.co__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.