difference between correctly and incorrectly applying a non-inheriting style property to a pair of TextArea controls : TextArea « Components « Flex






difference between correctly and incorrectly applying a non-inheriting style property to a pair of TextArea controls

difference between correctly and incorrectly applying a non-inheriting style property to a pair of TextArea controls
      


<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->


 
<!-- sparktextcontrols/TextAreaStyling.mxml --> 
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="doSomething()"> 
    <fx:Script> 
    private function doSomething():void { 
        /* To set a non-inheritable style on a TextArea, you must actually 
        apply it to the underlying RichEditableText subcomponent, which is 
        accessed through the textDisplay property: */ 
        text1.textDisplay.setStyle("columnCount", 2); 
        /* Setting a non-inheritable style directly on the TextArea does 
        not apply the style properly. */ 
        text2.setStyle("columnCount", 2); 
    } 
    </fx:Script> 
    <s:layout> 
        <s:VerticalLayout/> 
    </s:layout> 
    <s:TextArea id="text1" width="200" height="100"> 
        <s:textFlow> 
            <s:TextFlow> 
                <s:p>This is TextArea #1. This is enough text to ensure that there will be more 
                        than one column if the columnCount property is properly applied.</s:p> 
            </s:TextFlow> 
        </s:textFlow> 
    </s:TextArea> 
    <s:TextArea id="text2" width="200" height="100"> 
        <s:textFlow> 
            <s:TextFlow> 
                <s:p>This is TextArea #2. This is enough text to ensure that there will be more 
                    than one column if the columnCount property is properly applied.</s:p> 
            </s:TextFlow> 
        </s:textFlow> 
    </s:TextArea> 
</s:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.On value commit in a TextArea, display value by reference its idOn value commit in a TextArea, display value by reference its id
2.Retrieving the current color of the TextArea programmaticallyRetrieving the current color of the TextArea programmatically
3.Button Click event sets TextArea testButton Click event sets TextArea test
4.Binding data between TextInput and TextAreaBinding data between TextInput and TextArea
5.Update TextArea with an ActionScript function when clicking the ButtonUpdate TextArea with an ActionScript function when clicking the Button
6.Use click event to change the TextArea control's background colorUse click event to change the TextArea control's background color
7.Introspect Button control and prints details to TextArea controlsIntrospect Button control and prints details to TextArea controls
8.Creating a TextArea control with Creating a TextArea control with <mx:TextArea>
9.Pop up a TextArea control.Pop up a TextArea control.
10.Add click event for TextAreaAdd click event for TextArea
11.Set style for TextArea vertical scrollbarSet style for TextArea vertical scrollbar
12.Set text value to TextArea with MXMLSet text value to TextArea with MXML
13.HTML text inside TextAreaHTML text inside TextArea
14.Value inside curly braces {} binds the text property of a TextArea controlValue inside curly braces {} binds the text property of a TextArea control
15.Introspects the Button control and prints the details to TextArea controls:Introspects the Button control and prints the details to TextArea controls:
16.Set font style for TextArea and Button
17.Use FormItem to wrap TextAreaUse FormItem to wrap TextArea
18.Not editable TextAreaNot editable TextArea
19.Introspect a TextArea for its method name and return typeIntrospect a TextArea for its method name and return type
20.TextArea control is the binding destination, and both input1.text and input2.text are its binding sourcesTextArea control is the binding destination, and both input1.text and input2.text are its binding sources
21.Bind a source to TextAreaBind a source to TextArea
22.Enter text in TextInput control, text is converted to upper case as it is copied to TextAreaEnter text in TextInput control, text is converted to upper case as it is copied to TextArea
23.TextArea is for long textTextArea is for long text
24.Synchronize TextInput and TextArea with data bindingSynchronize TextInput and TextArea with data binding
25.Creating a TextArea control in MXML by using the tagCreating a TextArea control in MXML by using the <s:TextArea> tag
26.Add a block of TLF-formatted text to the TextArea controlAdd a block of TLF-formatted text to the TextArea control
27.TextArea StylesTextArea Styles
28.Use styled text inside an MX TextArea controlUse styled text inside an MX TextArea control
29.TextArea ControlTextArea Control
30.TextArea slowly wipes in on mouseDownTextArea slowly wipes in on mouseDown
31.Using enterState and exitState events to update two TextArea controls with the name of the new state and of the old stateUsing enterState and exitState events to update two TextArea controls with the name of the new state and of the old state
32.Get text indexesGet text indexes