grids to global functions
I started out trying to get my data grid to load data in a sub movie.
With no luck I've thought of trying to change some of my variables and functions to global since the data grid works fine in another layer by itself.
Now my global functions have me confused about the sequence in the program.
For instance, I have a global function that I use to load the variables.
// action script in the root of the movie
_global.loaddoors = function(filetoload){
myvars = new LoadVars();
myvars.load(filetoload);
myvars.onLoad = function(success){
trace("inside onload , success is "+success);
if(success){loadst = myvars.loadst;
if(myvars.doornames == undefined){
root.loadst += " No doors have been read from the database."
}else{
_global.doornamesA = myvars.doornames.split("|");
_global.doorpricesA = myvars.doorprices.split("|");
_global.doorquantitysA = myvars.quantitys.split("|");
_global.doordescsA = myvars.doorpics.split("|");
_global.doorpicsA = myvars.doorpics.split("|");
trace("returning 1");
return 1;
}
}else{return 0;
loadst += " Could not recieve the information from the server.";
}
};
loadst = "";
trace("exiting loaddoors method");
}
//Then in the sub movie I have:
var loadOK = new Boolean();
loadOK = _global.loaddoors("doors.txt");
trace("loadOK is "+loadOK);
if(loadOK){
trace("doors loaded ok");
}
/////// My traces is what I'm confused about ////////////
exiting loaddoors method
loadOK is
inside onload , success is true
returning 1
Why is exiting loaddoors method displayed first.
Why doesn't it fork to root then fork back to the frame that called it?
|