ok… all of my source files can be found here
http://www.centerspin.com/downloads/loader.zip
here is what I did.
I have a single blank movie clip set off stage with the following code attached to it
//this onClipEvent fires it’s code whenever something finishes
//loading into it.
onClipEvent(data){
_root.beginLoad();
}
I have the blank movie clip in my library set up with “Export” “Linkage”. set to the tag “blnkclp”. If you don’t know about linkage, and you have any questions, feel free to ask. Basicaly, it allows us to use the attachMovie() method on it, bringing in an instance of it at run time, to our movie.
the syntax for this method is
object.attachMovie(“linkageName”,“UniqueInstanceName”,depth);
in frame one of the main timeline I have this code
//lets load up those variables into the clip called varHolder
loadVariables(“movieNameLst.txt”,_root.varHolder);
//these are the location array
//first array handles y location second handles x location
//first number in the row, handles the first movie loaded in the list
//note though… it seems that the for in loop gets the last on the list first. So number f3 is at 0/0
locationy = new Array(0,100,200);
locationx = new Array(0,0,0);
//define function beginload.
function beginLoad(){
//initialize i
var i=0;
//for loop executes its script for each var in varHolder
for (var prop in varHolder){
//attach a blank movie clip to the stage for loading
_root.attachMovie(“blnkclp”,prop,i);
// trans=varHolder[prop];
// trace (trans);
//load a movie based upon the var into the target blank clip
loadMovie(varHolder[prop]+".swf",prop);
//call out to another function sending along the var “i” with
setLoc(prop,i);
//incriment i
i++;
}
}
// define the function setLocation
function setLoc(prop,i){
//set the _x property of the movie clip var loc, equal to the var loc of the array
_root[prop]._x=locationx*;
//see above
_root[prop]._y=locationy*;
}
so basicaly what it’s doing is, using a for loop to detect every variable that was loaded into the movie clip with the instance name “varHolder”. and for each variable it’s attaching a movie clip and then calling to a function which places that movie clip in the proper coordinate.
The flaw with this is that it does not, to my satisfaction, fully utilize flash. I should be able to set up an array to handle that data… I just can’t figure out how at this moment.
for now though… this is efficient and it works.
If you need help altering your files to this method, don’t be afraid to ask me to explain some aspect of it in more detail. That should be more than a mouthfull for now though.
enjoy