Help with rotator

Ok, I’ve been going through the code in this tutorial:
http://www.flash-db.com/Tutorials/loadingAS3/loadingData.php?page=1

I’ve got some issue with the code below. Check out the problems in the comments.

This is the output of the banner.php script(wrapped for readability):


image0=http://www.listinventory.com/file_uploads/banners/banner.swf&
image1=http://www.listinventory.com/file_uploads/banners/crimp.swf&cant=2


import fl.containers.UILoader;

var ar_movies:Array = new Array();
var movieIndex=0;

//Create the URLLoader instance
var xLoader:URLLoader = new URLLoader();
var aLoader:UILoader  = new UILoader;

addChild(aLoader);
aLoader.scaleContent = false;
aLoader.height = 90;
aLoader.width = 715;

//the data will come as URL-encoded variables
xLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

//Load using an URLRequest
xLoader.load(new URLRequest("http://www.listinventory.com/libs/class/banner.php"));

//onLoad handler listener
xLoader.addEventListener(Event.COMPLETE, onDataLoad);

//add a listener for the complete event
function onDataLoad(evt:Event){
  for(var i:uint=0; i<evt.target.data.cant; i++){
    // Push the values into the arrays
    this.ar_movies.push(evt.target.data["image"+i]);
    // What is this loader for?
    // var loader:Loader = new Loader()
    // loader.load(new URLRequest(evt.target.data["links"+i]))
  }
  // Now load the first movie into the loader
  aLoader.source = ar_movies[movieIndex]; // No movie shows!!!
}

// Now, how do I setup an event listener to wait for the 
// movie to finish and then load the next one in the UILoader?
function onMovieFinish(evt:Event) {
    //aLoader.source = ar_movies[movieIndex];
    //if (movieIndex >= ar_movies.length) {
    //    movieIndex = 0;
    //}
}

I’d have a look at the various as2 (and as3) queue loading classes available rather then reinvent the wheel if loading a bunch of sequential files/data

Ah, nevermind, I’ll go ask somewhere where I’ll at least get a response after 150 views.

Besides, it can’t be done using As3 code because the files being loaded are AS2.

Wow, over 50 views and no replies, hmmm, I thought this was the place the experts hung out???

Here is some updated code. I just need to know how to access the properties of the loaded clip so I can tell when it is finished and load another one from the array.


import fl.containers.UILoader;

var ar_movies:Array = new Array();
var ar_links:Array = new Array();

//Create the URLLoader instance
var xLoader:URLLoader = new URLLoader();
var aLoader:UILoader  = new UILoader;

addChild(aLoader);
aLoader.scaleContent = false;
aLoader.height = 90;
aLoader.width = 715;

//the data will come as URL-encoded variables
xLoader.dataFormat = URLLoaderDataFormat.VARIABLES

//Load using an URLRequest
xLoader.load(new URLRequest("http://www.listinventory.com/libs/class/banner.php"));

//onLoad handler listener
xLoader.addEventListener(Event.COMPLETE, onDataLoad)

//add a listener for the complete event
function onDataLoad(evt:Event){
  for(var i:uint=0; i<evt.target.data.cant; i++){
    // Push the values into the arrays
    this.ar_movies.push(evt.target.data["image"+i]);
    this.ar_links.push(evt.target.data["link"+i]);
  }
  // Now load the first movie into the loader
  aLoader.source = ar_movies[0]; // movie now shows!!!
}
// Now, how do I setup an event listener to wait for the 
// movie to finish and then load the next one in the UILoader?