all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

question: for loop


question: for loop foleyhk
2/17/2007 6:53:10 PM
flash actionscript:
Hi, can anyone tell me why am I get a error message when I click on the link? I
checked the XML file is fine and images are loaded properly except when I click
the links which comes up an error message that cannot find the URL. Thanks!



function loadXML(loaded) {
if (loaded) {
for (i=0; i<13; i++) {

eval("c"+i).mc_image.loadMovie(xmlData.firstChild.childNodes[i].childNodes[0]
..firstChild.nodeValue);
eval("c"+i).mc_link.onRelease = function() {

getURL(xmlData.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue,
"_blank");
};
}else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
Re: question: for loop kglad
2/17/2007 9:13:41 PM
assuming you've run trace() functions and the urls appear to be correct, you
probably have white space (usually carriage returns) at the end of the url.

you can check the length of one of your urls to confirm. to remedy, strip the
white space using the flash string methods.
AddThis Social Bookmark Button