6 Replies Latest reply on Aug 31, 2010 11:20 PM by learn n leverage

    Loading an SWF into my flash banner

    volterony22

      Hi there,

       

      I am creating a banner for a website, and I need to load an external swf of scrolling images that sits behind the layers in my flash banner.  A similar example would be the website:  www.miracledetail.co.uk. 

      I have created managed to create everything in this banner except the scrolling images, so I have an external swf file that needs to load into my flash banner project.

       

      I have tried this.....

       

      createEmptyMovieClip("anim", 0); // create a new but empty movie clip (anim)
      anim.loadMovie("animation.swf"); // load "animation.swf" into the empty (anim) movie clip
      anim._x = 100; // Adjust the position of the imported "animation.swf" file
      anim._y = 100;

       

      I have clicked on a the first frame on a layer on the timeline and inserted the above actionscript, with the anim.loadMovie function calling the external swf file.  However when I do this, the swf fulling loads and appears over the top of my banner and I dont see the banner at all.

       

      I have tried putting the action script on various layer so that the swf will play behind the other layers in the banner, but again it keep loading over the banner.

       

      Hopefully you know what I am trying to say here and what I am trying to achieve.  Also to add that I am not very good with flash at all (as you have probably guessed already) so any tutorial ideas or instructions on how to achieve this would be ideal.

       

       

      Kind regards

       

      Volterony22

        • 1. Re: Loading an SWF into my flash banner
          kglad Adobe Community Professional & MVP

          the easiest way to position a loaded swf is to create an empty movieclip in the authoring environment and place it where you want.  then use it for your load-target.

          1 person found this helpful
          • 2. Re: Loading an SWF into my flash banner
            volterony22 Level 1

            hi kglad I have tried this and the swf sits in the correct layer behind the other layers, but it does not work.  It sits there as a static image.  What I did was import the swf to the library, converted it into a movie clip symbol and named it Preivew.  I then dragged it on the the stage onto the layer.  I then clicked the first frame of the movieclip layer and added the actionscript:  loadMovie("Preview.swf");  this then loads the movie to play behind the other banner layer.  However as I was saying, the swf is not working and it just looks like a static image (from the 1st image in the swf's animation)

             

            Any idea what I am dowing wrong??

             

            thanks

            • 3. Re: Loading an SWF into my flash banner
              kglad Adobe Community Professional & MVP

              when you import a swf, you lose all actionscript.

               

              again, load your swf and use the empty movieclip as the load-target.

              1 person found this helpful
              • 4. Re: Loading an SWF into my flash banner
                learn n leverage Level 3

                Hi,

                Just to make it simple, create an empty movie clip on the stage itself instead of using an actionscript to do so and use the actionscript just to load the external swf into the movie clip.

                Create an empty movie clip on a layer below your intended layer where do you want to load an external swf on the satge. Now you can position the empty movie clip to the desired x,y on the stage OR you can use the actionscript to do so. Give an instance name to that empty movie clip say "loadermc" in Properties panel. Add the following code in the top most layer(have one dedicated to Actions if you do not have already)

                 

                //your empty movie clip instance name.loadMovie("URL to your external SWF file");

                loadermc.loadMovie("animation.swf");

                 

                //if you have not position the empty movieclip earlier, you can use your code to do so

                anim._x = 100; // Adjust the position of the imported "animation.swf" file
                anim._y = 100;

                 

                Hope this helps.

                Thanks!

                • 5. Re: Loading an SWF into my flash banner
                  volterony22 Level 1

                  This does help.  Thank you very much, I appreciate it!!

                  • 6. Re: Loading an SWF into my flash banner
                    learn n leverage Level 3

                    You are welcome, pls mark this post as Answered so that this become useful for other forum viewers.

                    Thanks!