7 Replies Latest reply on Jan 2, 2013 1:14 PM by Ned Murphy

    Loading External SWF that loads XML

    TheScarecrow Level 1

      Hey all I have a swf that loads an swf file into that loads pictures from an XML file thanks to Ned Murphy.  I have a new problems with it.  It works everywhere I try it except on the webserver.  When I try it I get nothing.  It doesnt seem to load the external SWf file or it may not be loading the XML file.  I am not sure why.  Has anyone ran into this before ? thanks.

       

      EDIT

      It works if I try the SWF from the webserver but when I embed it in an HTML file and run it through a broweser I get nothing.

        • 1. Re: Loading External SWF that loads XML
          Ned Murphy Adobe Community Professional & MVP

          If the swf is is another folder from the html page that embeds it, you probably need to adjust how you target the files that the swf's load. 

           

          When you embed an swf file into a web page, anything the swf loads has to be targeted as if that swf is in the same folder as the html page that holds it.  So if the html page uses something like "flash/main.swf" to embed the top level swf, then if the top level file loads another swf from that same flash folder it needs to also use the "flash/other.swf" regardless that it is in the same folder on the server.  When it's embedded in the page, it's as good as being wherever that page lives.

          1 person found this helpful
          • 2. Re: Loading External SWF that loads XML
            Ned Murphy Adobe Community Professional & MVP

            If you were to move the swf's into the same folder with the html page, that would probably cure the problem, but it is not necessary... you just need to be aware of how you need to target files.

            1 person found this helpful
            • 3. Re: Loading External SWF that loads XML
              TheScarecrow Level 1

              The code that calls it is this:

              my_loader.loadClip(currentArray+".swf", this["slideshow_mc"]);

               

              The SWF are all in the same folder... the HTML file is out one level.

              • 4. Re: Loading External SWF that loads XML
                TheScarecrow Level 1

                Does there have to be settings on the server for calling XML to work in the sub swf?

                • 5. Re: Loading External SWF that loads XML
                  Ned Murphy Adobe Community Professional & MVP

                  Because the html is out one level, if you reread my first response, I think you will find it applies and that you need to adjust how you target the secondary swf file... and likely any xml file and image files as well.  When you load that first swf into the html page, it is basically no longer in the same folder as the rest of the swf's... the same goes for the others once they get loaded by the first

                   

                  There should not need to be any settings for the server... an xml file is just a text file by another name.

                  2 people found this helpful
                  • 6. Re: Loading External SWF that loads XML
                    TheScarecrow Level 1

                    ok so let me get this straight.

                     

                    The main html refers to flash swf as   Flash/main.swf

                    So to load aonther on in to this main it must have the link to the swf as Flash/sub1.swf

                     

                    So now if the Sub1.swf is load an xml file of images does it have to refer to the main html page or to the swf file?

                    • 7. Re: Loading External SWF that loads XML
                      Ned Murphy Adobe Community Professional & MVP

                      I have never worked at that many levels, so I cannot provide the definitive answer.  My first inclination based on what I have told you so far would be to say you need to give the same consideration for the xml file.  If the second swf is loaded into the main, then it too is now sitting in the html file's folder (relatively speaking)... so to target the xml file, it should be using a path as if it too is in the html file's folder.

                      2 people found this helpful