try:
doc.onLoad = function (success){
trace("XML loaded");
search.path.to.your.object.initialized = true; //<--- this is important.
// this.initialized = true;
// _root.initialized = true;
}
HTH/Christoffer
"Jan-Paul K." <webforumsuser@macromedia.com> skrev i meddelandet
news:c1qv11$9gg$1@forums.macromedia.com...
[quoted text, click to view] > Hi,
>
> I tried for hours to get a class-instance variable to be set from within
a
> onLoad() function that is called once an xml file is loaded in the
constructor
> method.
>
> I triede several addressing methods (parent, this, root) none worked. The
> value of the initialized variable is always false. The getXMLString()
method is
> returning the content string of the xml file, so I know the myOnLoad
method has
> been called and the content has been loaded successfull.
>
> Any Ideas how I must refer to the instance variable to from within the
> myOnload function?
>
> Any hint is more than welcome!
>
> Tanks and greetz,
> Paul
>
> class com.pironet.psa.Configurator {
> var initialized:Boolean = false;
> var doc:XML;
> function Configurator( configFileURL:String ){
> this.doc = new XML();
> this.doc.ignoreWhite = true;
> this.doc.load( configFileURL );
>
> function myOnLoad() {
> trace("XML loaded");
> _parent.initialized = true;
> // this.initialized = true;
> // _root.initialized = true;
> }
> = myOnLoad;
> }
>
> function getXMLString(){
> return this.doc.toString();
> }
> }
>