0 Replies Latest reply on Oct 13, 2007 1:40 PM by Conquering_Lion

    Integrate spellchecker button into textarea

    Conquering_Lion
      This one should be easy for you gurus out there.

      I have the spell checker function working correctly Spell check

      Now I'd like to place the button into the rich textarea using a the addchild function

      Here's my code for the spellcheck

      <mx:VBox id="RTE" height="400" width="400" cornerRadius="10" borderStyle="solid" backgroundColor="#ff8040" verticalGap="16" label="RichTextEditor" horizontalAlign="center" backgroundAlpha="0.11" verticalAlign="middle" borderColor="#ff8040">
      <mx:Label text="SpellCheck - MXML with RichTextEditor" fontSize="14"/>
      <mx:RichTextEditor id="myRTE" width="336" height="221"
      text="/>
      <SpellCheckComponent
      inputTA="{myRTE}"
      tabPosition="top"
      urlString=" http://localhost/flex/spellCheck/flexgoogleapi.php"
      tabBackgroundColor="0x008fbb"
      />
      </mx:VBox>


      Here's the code to add the spellchecker button to the rich text area
      public function addSpellCheck():void {
      var but2:Button = new Button();
      but2.label = "Spellcheck";
      but2.addEventListener("click",Spellcheck);
      rt.toolbar.addChild(but2);
      }

      When I click the button, I need it to run the function named Spellcheck()
      e.g.
      public function Spellcheck(event:Event):void {

      }

      The function Spellcheck will run the component Spellcheck. I have to pass
      1. the API URL "e.g. http://spellcheck/spell.php
      2. the name of the textarea to ensure that it loads in the text area - I think this should be done via binding.