I have an external text file that loads into an array and splits at the commas that is working. The first item from the file is a link to a external .swf file which also loads wonderfully.
The loaded text file is this
PHP Code:
&labMap=testing.swf,working,off,broken
The other items from the file target frame labels inside a movieclip from the loaded swf file.
If I manually tell the items where to go it works
PHP Code:
var itemlocation=this.labMap[1];
floorplan.desk1.gotoAndPlay(itemlocation);
When I try to get the other items to do my bidding things aren't working so good. Either nothing happens or undefined errors. How do I use a loop to get the other items to trigger my movieclip without having to manually enter the information?
Here is the whole mess. help...
PHP Code:
var loadMap:LoadVars = new LoadVars();
loadMap.onLoad = function(success:Boolean):Void {
if (success) {
trace(this.labMap); // List all the names from the file
//Split the loaded text file at the commas
this.labMap = this.labMap.split(',');//split things at the comma
//load the room swf into the floorplan mc loacted on the stage
var floorplanitem=this.labMap[0];
this.createEmptyMovieClip("floorplan", 1);
//load the room status information into the appropriate spots when done loading
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace("movie loaded");
//movie loaded tell the movieclips inside the loaded swf where to go
var i:Number;
for (i = 0; i < this.labMap.length; i++) {
var desknumber ="desk"+i;
trace (desknumber);
var itemStatus=this.labMap[i];
floorplan.desknumber.gotoAndPlay(itemStatus);
}
}
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(floorplanitem, floorplan);
} else {
trace("Error");
}
}
//load the text file for the room contents
loadMap.load("loadVarsRooms.txt");