3 Replies Latest reply on Oct 6, 2006 1:31 PM by Peter Lorent

    Need Help with scope in event handlers in AS 2.0!

    ccaptainsubzero
      I am trying to integrate an XML loading script into my FLA. I got the script from a book (I'm learning this) and it worked fine when in a timeline frame (loaded all perfectly well), but when I put it into an AS 2.0 class (which I'd been using with hardcoded data for testing) all fails miserably. I'm trying to get the loaded XML data processed with another class private function when the onLoad event comes from loading the XML, but this second function never gets called. All just fails silently. PLUS I'm trying to store the loaded data into two arrays which are class properties so that I can access the data later. They are not accessible. If this seems muddled it's only because I've been banging my head against this for 2 hours. I've read Moock, and then I went to Macromedia's online help -- and you will see in my code that I tried to set up an "owner" variable to clarify scope. It didn't. Basically: how does one handle scope of other class functions AND class properties from within an event handler in the class? As a very important bonus question: is there a way to set up eventListeners and callback functions between classes, or is this verboten?

      Please help if you can -- I know it's obvious to you, and soon perhaps to me --

      Thanks -- Robert

      (Code follows)