6 Replies Latest reply on Sep 1, 2006 1:42 PM by crabshell2k

    Loading an external swf

    crabshell2k
      I'm trying to edit a disappearing developer's FLA where the link to an external SWF is somehow broken. The button that triggers the SWF has the following action tied to it:

      on (release)
      {
      gotoAndPlay("collection")
      }

      There is no scene named "collection", only an external swf called "spring.swf". When I change the actionscript to refer to "spring.swf" I get nothing.

      There is a script layer that has a single frame with a reference to spring.swf. It's action reads:

      stop()
      loadVariables("flash/spring.swf",placeholder).

      This action occurs on the same frame as an instance of the button.

      I am a novice to say the least and am totally baffled. Thanks for any advice.

        • 1. Re: Loading an external swf
          derobinson Level 1
          The reference to "collection" is to a frame label, not a scene, so look back through the timline (or use the movie/script explorer inthe Actionscript panel) to find a frame with that name. The button doesn't have anything to do with the loading of the external SWF, that's handle in the second bit of code you have there....though I have to say I've never seen loadVariables used to pull in a SWF...that should probably be loadMovie instead.

          Hope that helps!
          • 2. Re: Loading an external swf
            crabshell2k Level 1
            That makes sense -- frame labels. You learn something new... And the loadMovie seems to have fixed the problem. Another life saved -- thanks much!
            • 3. Re: Loading an external swf
              derobinson Level 1
              My pleasure! Good luck!
              • 4. Re: Loading an external swf
                crabshell2k Level 1
                Actually I'm still having trouble. This sounds strange, but the flash file works fine when played within Flash Player or Flash, but when embedded within HTML the external Flash file fails to play -- it just shows up as an empty white box. The issue is definatly not the path and without getting into a lengthy explaination, the problem isn't with the external file. Is there a better way to load the external SFW than LoadMovie?
                • 5. Re: Loading an external swf
                  derobinson Level 1
                  When you say it won't work when playing in an HTML file, is that on a server? Sounds like you're running into the security sandbox. Here are some notes from the docs that may help:

                  <snip>
                  For Flash Player 8:

                  --Loading is not allowed if the calling movie clip is in the local-with-file-system sandbox and the loaded movie clip is from a network sandbox.
                  --Loading is not allowed if the calling SWF file is in a network sandbox and the movie clip to be loaded is local.
                  --Network sandbox access from the local-trusted or local-with-networking sandbox requires permission from the website by means of a cross-domain policy file.
                  --Movie clips in the local-with-file-system sandbox may not script movie clips in the local-with-networking sandbox (and the reverse is also prevented).
                  </snip>

                  Let us know if that helps with the problem!
                  • 6. Re: Loading an external swf
                    crabshell2k Level 1
                    Thanks for the good advice. It turned out to be a path issue after all. I assumed the path was dependent upon the location of the swf, not the html file. Once I added the swf's directory to the path it worked just fine. Wish I had that day of my life back...