8 Replies Latest reply on May 17, 2009 4:25 PM by Michael Borbor

    cannot access event.text from my custom event

    DigitalSpeciaist

      I have a cutom event, and I want to access event.text when my custom event is dispatched and handled.

       

      package myCustomEvents.events
      {
          import flash.events.Event;

       

          public class ItemRemoved extends Event
          {
              public static const REMOVED_ITEM_EVENT:String = "itemRemoved";
              private var _removedItem:String;
             
              public function get removedItem():String {
                  return _removedItem;
              }
             
              public function ItemRemoved(removedItem:String)
              {
                  super(REMOVED_ITEM_EVENT);
                  _removedItem = removedItem;
              }
             
          }
      }

       

       

       

       

          // I have some html content with <a> </a> link tags in the textarea
                  <mx:TextArea link="dispatchEvent(new ItemRemoved(event));"  />

       

       

      private function removeSelectedItems (event:ItemRemoved):void
                                  {
                                  // I want to access event.text here
                                  var theText:String = event.text

       

                                  }

       

       

      Any ideas how to access event.text in this case? I get it to work when I do not use a custom event, and I cannot extend TextEvent.

       

      Thanks.