0 Replies Latest reply on Jul 17, 2006 11:37 AM by QBA_QBA

    Loading SWF Files in Groups

    QBA_QBA
      I need to download files in two or three groups because the real my working files are too big so I want to download the rest of the movies after the first group is loaded and playing.

      Inside the MasterListener.onLoadInit = function, I'm testing an if statement to target a movie already loaded on level 2 by going to a frameLabel "frame2Stop", and I'm testing to see if I can load new movies using "MasterListener.onLoadInit" once the first movie has been loaded.
      [code]
      _level2.gotoAndStop("frame2Stop");

      MasterLoader.loadClip("Movie2.swf", 3);
      MasterLoader.loadClip("Movie3.swf", 4);

      [/code]

      The code targetting the movieClip on level 2 is working, but the code trying to load movies using MasterListener.onLoadInit doesn't execute.

      Now the weird part is that inside the same function I have the same 3 lines of code from the if statement inside a onRelease "homeBtn" and all those 3 lines of codes work fine. so if I use them on a if statement only the one targetting the movieClip on the level 2 works, but it doesn't loads the other two movies, but if I turn off that if statement and execute the same code by clicking on the button the same 3 lines of codes works.

      [code]
      var MasterLoader:MovieClipLoader = new MovieClipLoader();

      //----Creating a variable "MasterListener"
      var MasterListener:Object = new Object();
      MasterLoader.addListener(MasterListener);

      // when the movies starts loading, stop it, and hide it
      MasterListener.onLoadStart = function(target_mc) {
      target_mc._visible = false;
      target_mc.stop();
      };

      // when the movies have loaded, play and show it
      MasterListener.onLoadInit = function(target_mc) {
      target_mc._visible = true;
      target_mc.gotoAndPlay(1);


      //MasterLoader.loadClip is not working inside the "if" statement

      if (_level2._visible == true){
      _level2.gotoAndStop("frame2Stop");

      MasterLoader.loadClip("Movie2.swf", 3);
      MasterLoader.loadClip("Movie3.swf", 4);

      }


      //Targering "homeBtn MovieCLip"
      target_mc.homeBtn.onRollOver = function(){
      target_mc.homeBtn.gotoAndStop("R_Over");
      };

      //MasterLoader.loadClip works on this onRelease function but only if the "if" statement above is turn off
      target_mc.homeBtn.onRelease = function(){
      _level2.gotoAndStop("frame2Stop");

      MasterLoader.loadClip("Movie2.swf", 3);
      MasterLoader.loadClip("Movie3.swf", 4);
      };
      };


      //---Loading externals swf----\\
      MasterLoader.loadClip("Movie1.swf", 2);
      MasterLoader.loadClip("Menu2.swf", 6);

      [/code]

      An if I run the if statement and the button at the same time none of the two works, so for the button to work the if statement have to be turn off

      Any ideas why ?