2 Replies Latest reply on May 10, 2007 2:33 PM by The Almighty Egg

    XML onLoad execution context

    The Almighty Egg Level 1
      i am loading data from an XML file using the XML object. the XML handling is being done in a class i have defined. the basic class definition is below (with extraneous code removed).

      the issue is that when that "trace" fires, it displays the contents of the XML object. in other words, the onLoad handler is executing in the context of the XML object rather than in the context of the class. so i cannot reference the XML object in the onLoad handler (ie using "xmlVideo.firstChild"). if i try to access any of the properties of the XML object using this (ie: "this.firstChild"), Flash gives me a compile error because the class does not have any such property.

      i have used a similar process to load XML with the actionscript on a frame rather than in a class. in that case, the onLoad handler executed in the context of the MovieClip not the context of the XML object. can anyone tell me how to deal with this? how can i access the properties of the XML object in the onLoad handler? better still, how can i persuade the onLoad handler to execute in the context of the class?