7 Replies Latest reply on Aug 3, 2009 8:10 PM by fiascoed

    Externally Loaded .SWF Issue

    fiascoed

      I've loaded an external .swf into a movieclip in my parent .swf using the loadMovie(); function. The file loads perfectly and in the right position, however I can no longer access the functions of the external .swf. When I load the file into a level rather than a movieclip, the functions (buttons and timeline) of the external .swf work properly.

       

      Is there any way to use the functions of the external .swf when I load it into an empty movie clip?

       

      Thanks in advance

        • 1. Re: Externally Loaded .SWF Issue
          webqaflash Level 3


          loadMovie("load.swf",loader_mc);    //OR  loader_mc.loadMovie("load.swf");

           

          In the above case load.swf loaded in movieclip loader_mc.

           

          If there is a function exists in the load.swf you can call as loader_mc.yourfunction();

          1 person found this helpful
          • 2. Re: Externally Loaded .SWF Issue
            fiascoed Level 1

            Thanks for the reply

             

            Unfortunately that's already the code I'm using to load the .swf in -- this file consists of several movie clips with rollover effects. Is that my issue?

            • 3. Re: Externally Loaded .SWF Issue
              webqaflash Level 3

              I think rollover effect is not aproblem.

               

              First test this calling a function in the loaded swf by  creating two test swfs.

              • 4. Re: Externally Loaded .SWF Issue
                Sreelash Level 1

                Hi, Load swf with the following code:

                 

                var mcl:MovieClipLoader=new MovieClipLoader();

                var lo:Object=new Object();

                lo.onLoadProgress=function(target:MovieClip,bl:Number,bt:Number){

                // create your preloader using bl(= bytes loaded) and bt(=bytes total)

                }

                mcl.addListener(lo);

                mcl.loadClip("001.swf",1);


                Actually the issue may due to the movieclips. Yoe are loading the external swf on a movieclip na? The rollover effect is not working after the swf loaded may due to this. Please reply me.

                 

                Thanks and regards,

                                          Sreelash

                1 person found this helpful
                • 5. Re: Externally Loaded .SWF Issue
                  webqaflash Level 3

                  Why don't you use loadMovie

                   

                  var container:MovieClip = this.createEmptyMovieClip("container", getNextHighestDepth());
                  container.loadMovie("load.swf");
                  test_btn.onRelease = function() {
                      container.test();
                  };

                   

                  Place a button on parent movie(instantname  test_btn);

                   

                  Write a function test in the load swf

                  • 6. Re: Externally Loaded .SWF Issue
                    Sreelash Level 1

                    Hi friend,

                     

                              swf can load with loadMovie also. In this case, you are loading swf inside a movieclip named container. In this case , when  onRollOver or onPress events are using on the loaded swf, I doubt that whether these events may work or not. have you tested with this. Can you please clarify my doubt. Thats why I used loadClip method. I am not sure whether i am thinking in right way.

                     

                    Thanks and Regards,

                                         Sreelash

                    • 7. Re: Externally Loaded .SWF Issue
                      fiascoed Level 1

                      Thanks for all the help -- turns out I just needed a _lockroot command on my empty movie clip