I’m trying to have my flash application interpret an XML file.
My code looks like:
var questions:XML = new XML();
questions.ignoreWhite=true;
questions.load('questions.txt');
questions.onLoad = function(success:Boolean){
if(success){
if(questions.status == 0){
trace("yay");
} else {
trace("Problem parsing XML.");
}
} else{
trace("Could not load XML");
}
}
stop();
the output i get is:
Could not load XML
Error opening URL 'file:///C|/Users/Peter/Desktop/Flash/questions.txt'
Does anyone have any idea why i can’t access this file? I’ve verified that the URL works.
Please be sure the file with the name questions.txt is there(in the same folder of your fla) coz the error is due to no file available at that url.
Don’t worry about the extension, it can load txt or xml file. What all you need to do is give the correct file name.