0 Replies Latest reply on Mar 21, 2009 3:37 PM by released87

    Rich Text Editor Issues

    released87
      Hi,

      I am using the Rich Text Editor for a simple CMS page. I have an image field and two paragraphs. The two paragraphs use the Rich Text Editor. However, it seems that the XML file will only update under certain conditions. There seems to be some sort of limit on the length. Basically I am passing the reconstructed XML to PHP which overwrites the XML file.

      I have an Alert popup when the update is completed. However, only sometimes will it popup, and it seems the more text I have the less it does. Is there something I should know about using the Rich Text Editor, or is it just buggy? I was thinking I needed to enable a 'mulitline' feature or set a 'maxchars' but the properties didn't seem to exist.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initPage()" width="100%" height="100%" >
      <mx:Script>
      <![CDATA[
      import mx.controls.Alert;
      import flash.events.*;
      import flash.net.*;
      import mx.collections.XMLListCollection;
      import mx.rpc.http.*;
      import mx.rpc.events.ResultEvent;

      public var aboutXML:XML= new XML();
      public var aboutRequest:HTTPService= new HTTPService();
      public var sendRequest:HTTPService= new HTTPService();
      public var variables:Object= new Object();

      [Bindable] public var imageString:String;
      [Bindable] public var topString:String;
      [Bindable] public var bottomString:String;
      [Bindable] public var outImage:String;;
      [Bindable] public var outTop:String;
      [Bindable] public var outBottom:String;
      public function initPage():void {
      aboutRequest.url= "about.xml";
      aboutRequest.resultFormat= 'e4x';
      aboutRequest.send(variables);
      aboutRequest.addEventListener(ResultEvent.RESULT, loadXML);
      }
      public function loadXML(event:ResultEvent):void {
      aboutXML= event.result as XML;
      image_about.source= aboutXML.image;
      input_image.text= aboutXML.image;
      input_top.htmlText= aboutXML.top;
      input_bottom.htmlText= aboutXML.bottom;
      }
      public function update():void {
      aboutXML.image= input_image.text;
      aboutXML.top= input_top.htmlText;
      aboutXML.bottom= input_bottom.htmlText;
      sendRequest.url= "actions.php";
      variables.action= "edit_about";
      variables.xmlString= aboutXML.toXMLString();
      Alert.show(variables.xmlString);
      sendRequest.send(variables);
      sendRequest.addEventListener(ResultEvent.RESULT, updateXML);
      }
      public function updateXML(event:ResultEvent):void{
      Alert.show("Update Complete");
      }
      ]]>
      </mx:Script>
      <mx:Box height="100%">
      <mx:Label text="About Image"/>
      <mx:Image id="image_about" />
      <mx:Label text="Image Source"/>
      <mx:TextInput id="input_image" />
      <mx:Button label="Update" click="update()"/>
      </mx:Box>
      <mx:HBox height="100%" >
      <mx:VBox>
      <mx:Label text="Top Paragraph"/>
      <mx:RichTextEditor id="input_top" width="350" height="250" >
      <mx:htmlText>
      <![CDATA[

      ]]>
      </mx:htmlText>
      </mx:RichTextEditor>
      </mx:VBox>
      <mx:VBox>
      <mx:Label text="Bottom Paragraph"/>
      <mx:RichTextEditor id="input_bottom" width="350" height="250" >
      <mx:htmlText>
      <![CDATA[

      ]]>
      </mx:htmlText>
      </mx:RichTextEditor>
      </mx:VBox>
      </mx:HBox>
      </mx:VBox>