Here’s my code:
function loadProjects(loaded){
if(loaded){
projects = this.firstChild.childNodes;
projectName = new Array();
projectImage = new Array();
projectDesc = new Array();
projectShtDesc = new Array();
projectLink = new Array();
projectNext = new Array();
for(i = 0;i < projects.length;i++){
projectName.push(projects*.attributes.name);
}
trace(projectName);
trace(projectName.length);
}
else {
trace("PROJECTS NOT LOADED");
}
}
projectData = new XML();
projectData.ignoreWhite = true;
projectData.onLoad = loadProjects;
projectData.load("projectData.xml");
var numProjects = projectName.length;
trace(projectName);
trace(numProjects);
the traces within the function return correct results, however when trace values of the arrays within the function and created by the xml are attempted results are returned ‘undefined’.
Why can I not access arrays made in this way from outside of the function?
thanks!