4 Replies Latest reply on Apr 24, 2006 2:00 AM by mr.eddy

    loadMovie()

    mr.eddy
      Hi,

      If you embed your SWF on a HTML page that is not in the same folder as the SWF file, any loadMovie() in the SWF will fail because the relative path used is the path of the HTML file and not the SWF file??? This seems absurd. Workarounds needed ASAP!
        • 1. Re: loadMovie()
          Level 7
          Why can't you have the SWF in the same folder as the HTML? If you can't do
          that, I'd think you'd probably need to hardcode a path variable in your
          movie, and then reference it whenever you want to specify a relative path.
          Something like:

          var realPath = " http: // www. mydomain.com/flash/myfolder/"; <spaces add so
          it doesn't make a link

          Then, instead of doing something like this:

          holder.loadMovie("images/truffle.jpg");

          You'd do:

          holder.loadMovie(realPath + "images/truffle.jpg");




          --
          Dave -
          Adobe Community Expert
          www.blurredistinction.com
          www.macromedia.com/support/forums/team_macromedia/


          • 2. Re: loadMovie()
            Rothrock Level 5
            The work around is pretty simple: Use a relative path from your html.
            • 3. Re: loadMovie()
              Level 7
              var myUrl:String = _url.substr(0, _url.lastIndexOf( "/" ) + 1 )
              trace (myUrl);

              loader_mc.loadMovie(myUrl + "ExternalMovie.swf");



              --
              Lon Hosford
              www.lonhosford.com
              May many happy bits flow your way!
              "mr.eddy" <webforumsuser@macromedia.com> wrote in message
              news:e104fa$dnp$1@forums.macromedia.com...
              Hi,

              If you embed your SWF on a HTML page that is not in the same folder as the
              SWF
              file, any loadMovie() in the SWF will fail because the relative path used is
              the path of the HTML file and not the SWF file??? This seems absurd.
              Workarounds needed ASAP!


              • 4. Re: loadMovie()
                mr.eddy Level 1
                Thank you all for your replys!

                I actually ended up hardcoding the url in the movie. It is a cross domain thingie so I can not use a relative path in HTML. However I do not know wether the _url variable would have worked, I think it still points to the url of the HTML. I might have tested that but can't remember.

                Ed