1 Reply Latest reply on Dec 4, 2007 3:30 AM by kcell

    Create custom component problem

      When I create a custom component as InputTextBox + Button, how can I add new events to handle click button in this new component and handle function key press in textbox?
        • 1. Re: Create custom component problem
          kcell Level 2
          Have you tried to register for the events in your component ("change"/textbox and "click"/button with the addeventlistener function of the subcomponents)?

          In the eventlistener functions in you component you can prevent that the sub events are sent out of your component by using "event.stopImmediatePropagation();".

          You can also dispatch your own event if you want by using something like this:

          private function onEnterButtonClick(event:Event):void
          var aEvent:Event = new Event("enterButtonClicked", true);
          dispatchEvent( aEvent );

          best regards,