Flex Wares

Sample Components, Apps, Demos for Adobe Flex 2.0. Everything posted here is freeware. The code is available under MIT License. Please do send me a note if you are using it on a public url.
Feeds Feed Burner, Atom

Thursday, May 18, 2006

RichTextEditor with floating Toolbar

If you are wondering how to make the Toolbar of a RichTextEditor floating. Here's the code:




<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" height="100%">
<mx:Style>
TitleWindow
{
backgroundAlpha: 0.9;
backgroundColor: #9199A4;
borderColor: #9199A4;
borderAlpha: 1.0;
borderStyle: "none";
borderThickness: 0;
paddingBottom: 0;
paddingLeft: 0;
paddingRight: 0;
paddingTop: 0;
}
</mx:Style>

<mx:Script>
<![CDATA[
import mx.managers.*;

private function floatControlBar() : void
{
rteControl.parent.removeChild(rteControl);
rteControl.addChild(DisplayObject(rte.toolbar));
rte.showControlBar=false;
mx.managers.PopUpManager.addPopUp(rteControl, rte, false);
}
]]>
</mx:Script>

<mx:RichTextEditor id="rte" htmlText="" headerHeight="5"
creationComplete="floatControlBar()"/>
<mx:TitleWindow id="rteControl" width="325" title="ToolBar"/>

</mx:Application>

4 Comments:

Blogger Shizam said...

Thanks,
Works like a charm!

Thursday, September 20, 2007 10:14:00 AM  
Anonymous Anonymous said...

Great Job. Thanks.

Friday, February 22, 2008 2:56:00 AM  
Anonymous Anonymous said...

Such dirty !!! You should know that now Flex SDK is open source ;-) so, take a look on RichTextEditor souce ... Is just a MXML file with a panel and a TextArea and a Toolbar inside... Cleaner solution is to copy this code in your own RichTextArea (and you can customize it as you want).

Monday, March 17, 2008 7:23:00 AM  
Anonymous varun said...

Thanks, It is good

Thursday, October 21, 2010 6:59:00 AM  

Post a Comment

<< Home