3 Replies Latest reply on Feb 14, 2012 8:04 AM by oldMster

    Listener doesn't get called

    JackHombre Level 1

      My basic problem is that I have this custom component. Sometimes the owner of the component needs to have a handler called when a certain button is pushed in the component. I figured the best way to do that is to have the owner add a listener to that button, but it's not working. Is there a better way?

      In the parent (an mx:Module) my custom component is "Assign". I have in the creationComplete


      Assign["btn"].addEventListener("itemClick", qil);




      private function qil(evt:ItemClickEvent):void {
      trace("button event");


      Now that should work, because if after the addEventListener() I have


      Assign["btn"].label = "special button";


      then the button's label is changed. But no matter what I do, I can't get that trace to be called. No errors are generated. What do I do?


      It's Flex 3.0 I'm running.