2 Replies Latest reply on Apr 11, 2007 9:49 PM by 'TzmNe!!!

    Trouble Adding An Event Listener

      I'm new to Flex, but I am trying to learn it for use with Apollo. I cannot figure how to add an event listener for my MX:HTML component. (I think this component is only for Apollo, but I can't get the event listeners to work for an components!)

      When the MXML file begins to run, it adds the event listener:

      htmlcontent.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, golink);

      It should call the golink() function every time htmlcontent.location changes (the URL for the HTML component), but it does not.

      The program compiles, but never runs golink(). Why will this not work? Is there another way to add event listeners?

      Event function:
      private function golink(e:PropertyChangeEvent):void
      if (textinputurl.text != htmlcontent.location)
      textinputurl.text = htmlcontent.location;

      HTML component:
      <mx:HTML id="htmlcontent" x="0" width="100%" y="0" height="100%" location="main.html" visible="true"/>