7 Replies Latest reply on Feb 15, 2010 5:38 PM by kglad

    Load external SWF's help

    jynx19

      I am using this thumbnail gallery attached but instead of loading images through the xml I want to load external SWF'S. I also want to be able to control each SWF loaded in individually apparently in order to do that I need to give the container different instance names..however I don't know how to extend the code inorder to achieve this..can anyone help?

       

        • 1. Re: Load external SWF's help
          kglad Adobe Community Professional & MVP

          you can reference a loaded swf by using the target movieclip's instance name AFTER loading is complete.  if you don't understand how that applies to your code, post (only) the code that loads swfs.

          • 2. Re: Load external SWF's help
            jynx19 Level 1

            Hello Kglad,

             

             

            Thank you for the swift reply, I don't know how to apply this to my code. At the moment it loads in images but it will load in external SWF's I pressume this is the section of code relevant;

             

            function thumbnailer(k){
            total_thumbs = _global.total;
            var container = thumbnail_mc.createEmptyMovieClip("th"+k,thumbnail_mc.getNextHighestDepth());
            container._visible=false;
            container._alpha=0;
            var image = container.createEmptyMovieClip("img", container.getNextHighestDepth());
            tlistener = new Object();
            tlistener.onLoadInit = function(target_mc) {
              target_mc.pictureValue = k;
              target_mc.onRollOver = function() {
               this._alpha = 50;
              };
              target_mc.onRollOut = function() {
               this._alpha = 100;
              }
            };
            image_mcl = new MovieClipLoader();
            image_mcl.addListener(tlistener);
            image_mcl.loadClip(thumbnails[k], "thumbnail_mc.th"+k+".img");
            }

            • 3. Re: Load external SWF's help
              kglad Adobe Community Professional & MVP

              to control the swf at thumbnails[k], you reference:

               

              thumbnail_mc["th"+k]

               

              from the timeline that contains thumbnail_mc.

               

              in addition, you should fix your code:

               


               

              function thumbnailer(k){
              total_thumbs = _global.total;
              var container = thumbnail_mc.createEmptyMovieClip("th"+k,thumbnail_mc.getNextHighestDepth());
              container._alpha=0;
              var image = container.createEmptyMovieClip("img", container.getNextHighestDepth());

              image_mcl.loadClip(thumbnails[k], image);
              }

               

              tlistener = new Object();
              image_mcl = new MovieClipLoader();
              image_mcl.addListener(tlistener);
              tlistener.onLoadInit = function(target_mc) {
                target_mc.pictureValue = k;
                target_mc.onRollOver = function() {
                 this._alpha = 50;
                };
                target_mc.onRollOut = function() {
                 this._alpha = 100;
                }
              };
              • 4. Re: Load external SWF's help
                jynx19 Level 1

                kglad thank you for your help, I don't mean

                to be a pain but do you mind explaining what is meant by referencing from the timeline?

                 

                Thanks for your paitence

                • 5. Re: Load external SWF's help
                  kglad Adobe Community Professional & MVP

                  if you attach code to the same timeline that contains the above code, use:

                   

                  thumbnail_mc["th"+k]

                   

                  /////////////////////

                   

                  if you attached code to a child movieclip of the timeline with the above code, use:

                   

                  parent.thumbnail_mc["th"+k];

                  • 6. Re: Load external SWF's help
                    jynx19 Level 1

                    In that case i'd need to use; thumbnail_mc["th"+k]

                    the only thing im confused about now is if I'm loading in multiple SWF's using ; thumbnail_mc["th"+k] would that not apply the code to all the SWF's where as i'd want to target one?

                     

                    Thanks for all your help, learning slowly but surely

                    • 7. Re: Load external SWF's help
                      kglad Adobe Community Professional & MVP

                      you'll have a distinct target and distinct swf for each k.