Dynamic Loading + Timing

I’m having a few problems with loading swf after swf. I want one swf to load after another has loaded and so on… Down a long chain until everything is loaded.

I know this code doesn’t work… But it shows you what I’m trying to do.

Should I use listeners to achieve this? Because _root.theMC.onLoad = function(){-Do Stuff-} doesn’t seem to work at all…


  // Loading the first file.. .This works
 _root.profile.pContent.loadMovie("http://files.hosting.com/files/profile.swf"+noCacheString);
  //This does not work...
 _root.profile.pContent.onLoad = function() {
        _root.background1.loadMovie("http://files.hosting.com/files/background.swf");
    };
//Or this either...
    _root.background1.onLoad = function() {
        _root.curtain.play();
    };

Hmmm… Argh… Not working!


    _root.profile.pContent.onLoadComplete = function(container:MovieClip) {
        _root.background1.loadMovie("http://files.myspace-hosting.com/files/422/background.swf");
    };

This doesn’t work right either… I’m tired… Time to take a break.


    myMCL = new MovieClipLoader();
    myListener = new Object();

    myListener.onLoadComplete = function(targetMC) {
            bah = targetMC; // Just a test to see if it's working right.
    };

    myMCL.loadClip("http://files.hosting.com/files/422/background.swf", _root.profile.pContent);
    myMCL.addListener(myListener);