Why can I not access the data loaded from an external text file outside this function?
[AS]loadText = new loadVars();
loadText.load(“movieList.txt”);
//creating the loadVarsText function
loadText.onLoad = function() {
movieArray = this.movieList.split("/");
trace(_root.movieArray) //shows loaded data correctly
}
trace(_root.movieArray); //shows ‘undefined’[/AS]
the first trace within the function displays the loaded data correctly, the second trace just shows “undefined”
And why does the second trace show in the output window BEFORE the first as coded? i.e.
undefined
arr1,arr2,arr3
Thanks