11 Replies Latest reply: May 24, 2012 3:35 PM by Ron Colmen RSS

    loader to reach 100% after loading several SWFs?

    Ron Colmen Community Member

      How do I make the loader reach 100% when all a.swf, b.swfs, c.wfs and d.swf completes loading?

       

      prototypeLDR.addListener(prototypeLO);

      var swfsLoaded:Number=0;

      var prototypeLDR:MovieClipLoader = new MovieClipLoader();

      var prototypeLO:Object = {}; prototypeLDR.addListener(prototypeLO);

       

      prototypeLO.onLoadInit = function(targetMC2:MovieClip){

                swfsLoaded++;

                if(swfsLoaded==4){

                          for (i=1; i<5; i++) {

                                    _root.vest_mc["mcA"+i+"_mc"]._visible=false;

                }

                _root.loaderBar2._visible = false;

                _root.borderX2._visible = false;

                _root.loaderBack2._visible = false;

                _root.gotoAndPlay(9);

                }

      }

       

      prototypeLO.onLoadStart = function(targetMC2) {

                _root.loaderBar2._visible = true;

                _root.borderX2._visible = true;

                _root.loaderBack2._visible = true;

      };

       

      prototypeLO.onLoadProgress = function(targetMC2, lBytes, tBytes) {

                _root.loaderBar2._width = (lBytes/tBytes)*100;

                _root.percentDisplayZ.text = "% "+Math.round((lBytes/tBytes)*100);

      };

       

      btn.onRelease = function() {

                           prototypeLDR.loadClip("www.web.com/myfile/a.swf,_root.main1_mc);

                          prototypeLDR.loadClip("www.web.com/myfile/b.swf,_root.main2_mc);

                          prototypeLDR.loadClip("www.web.com/myfile/c.swf,_root.main3_mc);

                          prototypeLDR.loadClip("www.web.com/myfile/d.swf,_root.main4_mc);

      //do more...

      }