-
Testing the movie traces "false":
(First frame, no buttons, no nothing)
myXML = new XML();
myXML.load("realdoc.xml");
trace(myXML.loaded);
I've tried a hell lot of Templates of yours. For example the "Ticker" and others with attached *.as-files. They all working fine.
I've reduced the FLA and XML-file to the simplest.
Whats going wrong?
-
.loaded is a test that returns a boolean value to indicate if the XML document has finished loading or not. You are getting false, beacuse you have check immediatly after the initial request is made, and thus doesn't have a chance to finish loading.
You want it to be more like:
Code:
myXML = new XML();
myXML.onLoad = trace (myXML);
myXML.load("realdoc.xml");
Don't hold me to that, but it should be ok. The onLoad method should be called when the document is finished loading. If that doesn't suit you, you can always use
Code:
if (myXML.loaded){
trace (myXML);
}
in a loop to perform multiple statements, but its up to whatever you feel happiest with. Oh and of course you replace trace (myXML) with whatever you want to be called when the document is loaded, like a whitespace remover.
-
Thanx!
Thanx
Originally posted by The_Offspring
.loaded is a test that returns a boolean value to indicate if the XML document has finished loading or not. You are getting false, beacuse you have check immediatly after the initial request is made, and thus doesn't have a chance to finish loading.
You want it to be more like:
Code:
myXML = new XML();
myXML.onLoad = trace (myXML);
myXML.load("realdoc.xml");
Don't hold me to that, but it should be ok. The onLoad method should be called when the document is finished loading. If that doesn't suit you, you can always use
Code:
if (myXML.loaded){
trace (myXML);
}
in a loop to perform multiple statements, but its up to whatever you feel happiest with. Oh and of course you replace trace (myXML) with whatever you want to be called when the document is loaded, like a whitespace remover.
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
|