Home Tutorial Flex Flex4 Components RicheditableText in Flex4

 
 

Share on Google+Share on Google+
RicheditableText in Flex4
Posted on: April 24, 2010 at 12:00 AM
Advertisement
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>

<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.

</s:p>

</s:TextFlow>

</s:textFlow>

</s:RichEditableText>

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

<s:stroke>

<s:SolidColorStroke color="blue"/>

</s:stroke>

</s:Rect>

</s:Group>

</s:HGroup>

<s:HGroup>

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

</s:HGroup>

</s:VGroup>

</s:Panel>

</s:Application>

Output:


Running Application:

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

Download this code

Advertisement

Related Tags for RicheditableText in Flex4:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 24, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com