|
Hey,
Ok, this really will stress my english, so bear with me.
I have a problem calling a method of the document class from any other class. Since I don't know the "name" of this instance I can not call it directly. AS3 does not give it a name by which I can call it, nor does it allow me, as far as I know, to name it myself (which then would maybe make it possible to write it into a global variable).
I tried adding a 'this' as parameter when I would create an instance of another class inside the document class. Then I would save it in a class property of the type 'Object'. But that caused an TypeError (namely #1010) later on.
Next I tried the aquivalent of the public static var by stating my document class method simply 'public static function'! But - as I just read and experienced - then I get a problem calling other methods from within THIS method.
There's even a problem when I work with instances of display classes, that I added as child to the document class instance. Inside this display class I tried refering to the parent instance as - well, parent, obviously, but that did not work either. That only works with event.target.parent somehow. But for that I need an event.
So is this a conceptual error on my side - or is it AS3 and I just have to live with it and try working around it? I usually can, but this time, I need to call back to the document class instance because I have to wait for an xml-file to load!
|