RicheditableText in Flex4


 

RicheditableText in Flex4

In Flex4 The RichEditableText control is just like a RichText control in which the text display in richly-formatted text, with multiple character and paragraph formats

In Flex4 The RichEditableText control is just like a RichText control in which the text display in richly-formatted text, with multiple character and paragraph formats

RichEditableText in flex4:

In Flex4 the RichEditableText control is just like a RichText control in which the text display in richly-formatted text, with multiple character and paragraph formats. It is a interactive component because in which you can use hyperlinks, scrolling, selection, and editing properties.

The RichEditableText class is same as the TextArea control class, but it does not have a border, scroll bars, or focus glow. You can use the textFlow, text, and content properties For specifying the text in the RichEditableText control. It supports the insertText() and appendText() methods for insert and append to the text respectively. The tag of RichEditableText is <s:RichEditableText>.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx" >

<fx:Script>

<![CDATA[

public function clear():void{

ricTxt.text="";

}

]]>

</fx:Script>

<s:Panel title="RichEditableText Example" width="335" height="203" color="#990000">

<s:VGroup x="12" y="6" width="311" height="154">

<s:HGroup>

<s:Group x="100" y="0">

<s:RichEditableText id="ricTxt"

editable="true"

selectable="true"

width="310"

height="124"

paddingTop="5"

paddingLeft="5"

paddingBottom="5"

paddingRight="5"

color="#000000"

lineBreak="toFit">

<s:textFlow>

<s:TextFlow>

0

<s:p>This is a RichEditableText component of flex 4. It has feature of writing, editing text in multiple lines. It too have the hyperlinks, scrolling, selection properties.

At runtime of application you can edit and can format the paragraph also.

To visit: <s:a href="http://www.roseindia.net">Roseindia.net</s:a> hold CTRL key and then click.

1

</s:p>

</s:TextFlow>

</s:textFlow>

2

</s:RichEditableText>

<s:Rect width="100%" height="124">

<s:stroke>

3

<s:SolidColorStroke color="blue"/>

</s:stroke>

</s:Rect>

4

</s:Group>

</s:HGroup>

<s:HGroup>

5

<s:Button id="clr" label="Reset" click="clear()"/>

</s:HGroup>

</s:VGroup>

6

</s:Panel>

</s:Application>

Output:


Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

7

Download this code

Ads