2 Replies Latest reply on Apr 13, 2010 2:15 AM by RandomReado

    Bug: RichTextEditor "Initialize" not classed as event handler

    RandomReado Level 1

      I'm trying to load the RichTextEditor control in a popup window. Here's my code:

       

      var rte:RichTextEditor = new RichTextEditor();
      
      rte.width   =  600;
      rte.height  =  500;
      rte.title   =  'Edit Text';
      

       

      I need to add the initialize event handler so I can add a button to the toolbar (as per the example on the Adobe website).

       

      However, when I type:

       

      rte.initialize  =  "addSaveButton()";
      

       

      Flash Builder says this is invalid as "initialize" is actually a function and doesn't accept any parameters.

       

      Compare this with:

       

      <mx:RichTextEditor initialize="addSaveButton()"/>
      

       

      Flash Builder recongises "initialize" as an event handler and therefore accepts the addSaveButton() function.

       

      Can anyone else confirm whether this is a bug with the SDK or not? I can simply add the button outside of the RTE for now, but then I'd have to wrap the RTE in a separate panel to accomodate the button, which isn't ideal.

       

      Thanks in advance.