I want to move the controlbar of the RichTextEditor above the TextArea instead 
of the default of being below the TextArea.
 
I've been playing around with it as follows but I have a feeling I should not 
do this in the updateDisplayList method.
 
Should I do it in the initialize method?
 
<?xml version="1.0" encoding="utf-8"?>
<mx:RichTextEditor xmlns:mx="http://www.adobe.com/2006/mxml";>
  <mx:Script>
    <![CDATA[
      import mx.controls.TextArea;
      import mx.core.UIComponent;
      
      override protected function updateDisplayList(unscaledWidth:Number, 
unscaledHeight:Number):void{
        var txt:TextArea = TextArea(super.removeChild(textArea));
        var cb:DisplayObject = DisplayObject(super.removeChild(this.controlBar 
as DisplayObject));
        super.addChild(cb);
        super.addChild(new TextArea());
        super.updateDisplayList(unscaledWidth, unscaledHeight);
      }
    ]]>
  </mx:Script>
</mx:RichTextEditor>

 
 
This doesn't work either:

 
 
<?xml version="1.0" encoding="utf-8"?>
<mx:RichTextEditor xmlns:mx="http://www.adobe.com/2006/mxml";
  creationComplete="setupUI();">
  <mx:Script>
    <![CDATA[
      import mx.controls.TextArea;
      import mx.core.UIComponent;
      
      private function setupUI():void{
        var taIndex:uint;
        var cbIndex:uint;
        for(var a:uint=0;a<this.rawChildren.numChildren;a++){
          trace(this.rawChildren.getChildAt(a));
          if(a==2){
            var disObj:DisplayObject = this.rawChildren.removeChildAt(a);
            this.rawChildren.addChildAt(disObj, 1);
          }
        }
        trace("**************************");
        for(var b:uint=0;b<this.rawChildren.numChildren;b++){
          trace(this.rawChildren.getChildAt(b));
        }
      }
    ]]>
  </mx:Script>
</mx:RichTextEditor>


Reply via email to