-
XML onReply problem in Object
Hello,
I have a problem/bug that (perhaps it is me) or perhaps not.
I have and Object
oContainer
defined as
oContainer = new Object();
oContainer =
{
sTEST : new String(),
fnFUNCTION : function(sName,iID)
etc....
}
In this object I have XML loading functions
as in
fnLoad : function() {
XML = new XML();
this.sTEST = "hi";
XML.onLoad = this.onReply;
XML.ignoreWhite = true;
XML.load("http://domain/load.xml);
},
onReply : function (bSuccess)
{
if (bSuccess == true) {
// HERE IS THE PROBLEM AREA VERY FEW THINGS WORK HERE
trace(this.sTEST); // THIS DOESN't
trace ("hello") // THIS WORKS
} else {
_root.tError = aError[XML_FORUMLOAD_ERROR];
}
So the problem bieng I cannot access member variables from the onReply method. Is this normal??? I can remove the XML processing INFO from the object and things work but it isn't as pretty, I would like to keep everything in one object...
Thanks in advance for any help
-
Senior Member
You will find that in onReply that 'this' refers to the XML document that has just been loaded.
Thanks
Luke
-
Ah thanks, I see so I have to use _root.oObjectName.method in order to access member varibles and methods..
Thanks
Stefan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|