7 Replies Latest reply on Nov 12, 2007 6:57 AM by kglad

    Preloading external swf

    P_e_r_o
      Hello!

      I have a big problem. In my flash site I have one main swf that loades other external swfs with a preloader and that works fine. But some external swfs load external data like pictures and text. What do I have to do that the main swf preloader, preloades external swfs external data.

      Thank you for your help!
        • 1. Re: Preloading external swf
          kglad Adobe Community Professional & MVP
          use the correct paths to the object receiving data and swfs.
          • 2. Re: Preloading external swf
            P_e_r_o Level 1
            This is the code for the preloader:

            btn_mc.onRelease = function() {
            mcLoader.loadClip("gallery.swf", swfLoader);

            The movie clip in the gallery.swf loades external pictures. What is the path to that movie clip? Do I put the path in the code above?
            • 3. Re: Preloading external swf
              kglad Adobe Community Professional & MVP
              that code loads gallery.swf into the target movieclip swfLoader when btn_mc is released.

              swfLoader.theTargetInGallery is the target of whatever is loaded by gallery.swf.
              • 4. Re: Preloading external swf
                P_e_r_o Level 1
                This is the code for the preloader and the button:

                var mcLoader:MovieClipLoader = new MovieClipLoader();
                var myListener:Object = new Object();

                mcLoader.addListener(myListener);

                myListener.onLoadProgress = function(target_mc,bytesLoaded,bytesTotal) {

                var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
                extLoader1_mc.extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
                }

                btn_mc.onRelease = function() {
                mcLoader.loadClip("gallery.swf", swfLoader);
                ////////////////////////////////////////////////////////////////////////////////////////// ///////////////
                picLoader=theTargetInGallery
                If I write:

                btn_mc.onRelease = function() {
                mcLoader.loadClip("gallery.swf", swfLoader.picLoader);

                It doesn't work

                Thanks for helping!
                • 5. Re: Preloading external swf
                  kglad Adobe Community Professional & MVP
                  theTargetInGallery is probably not the instance name of your target movieclip in gallery. i just picked that name because it's descriptive.
                  • 6. Re: Preloading external swf
                    P_e_r_o Level 1
                    Yes I know that. But I don't know how can I write the root to the movie clip in the external swf, from the main swf?
                    • 7. Re: Preloading external swf
                      kglad Adobe Community Professional & MVP
                      the main timeline of your external swf is referenced (after loading is complete) by referencing the load target:

                      swfLoader.picLoader (in your most recent post),
                      swfLoader (in your 2nd post).