Flex rich text editor with toolbar at top instead of bottom

<mx:RichTextEditor id=”richTextEditor” creationComplete=”richTextEditor_creationCompleteHandler(event)”
width=”550″ height=”200″
headerHeight=”0″ />

Script:

protected function richTextEditor_creationCompleteHandler(event:FlexEvent):void

{
richTextEditor.toolbar.removeChild(richTextEditor.linkTextInput)

/* toolbar is in ControlBar, ControlBar is not a direct content
child of the Panel in RichTextEditor. */

richTextEditor.toolbar.parent.removeChild(richTextEditor.toolbar);
controlBarContainer = new HBox();
controlBarContainer.percentWidth = 100;
controlBarContainer.setStyle(‘paddingLeft’, 5);
controlBarContainer.setStyle(‘paddingTop’, 5);
controlBarContainer.setStyle(‘paddingRight’, 5);
controlBarContainer.setStyle(‘paddingBottom’, 5);
controlBarContainer.addChild(richTextEditor.toolbar);
richTextEditor.addChildAt(controlBarContainer, 0);

}

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: