I created a class file and in constructor loading a XML file
and on Load of XML I am calling different function with in the same
class, but it is not executing can you please tell me where is the
Here is the code given below.
private var myXML:XML;
public function myClass()
myXML.onLoad = function()
displaText() // This is the function which is not calling
public function displaText()
When you call a function within an onLoad event, that
function is scoped to the object being loaded. If you want to call
a method from another object (in this case from your 'myClass'
class), you need to use a reference to the object that contains the
Don't forget to use the new XML constructor when
instantiating your XML object:
myXML= new XML();
Also... it's a best practices thing... you should capitalize
your class names (MyClass instead of myClass). You'd then likely
use the lower case (myClass) to name an instance of the class.