9 Replies Latest reply on Sep 21, 2006 8:39 AM by Dread_Pirate_Pete

    external relative path problems

      I have a movie that uses 9 instances of a blank 'photo' symbol, each with a unique instance name. For each instance, a different .png file gets loaded into a nested mc using the loadClip method. These .png files are not in the library, they sit separately on the server.

      The path to the correct .png file is determined dynamically for each instance by taking the instance name (eg. luke_mc), and adding and subtracting certain strings to arrive at a relative file path. Eg. luke_mc resolves to:

      This works perfectly in local movie testing but once the files are on the server the .png files do not appear to be retrieved. I've checked that the files are in fact in place and that the server's folder structure is the same as the local setup. I'm at a loss. Can anyone help?

      I'll append the code I'm using.
        • 1. Re: external relative path problems
          ricklecoat Level 1
          I should add that the above code sits in the first frame of the blank photo instance, not in the containing swf timeline.
          • 2. Re: external relative path problems
            ricklecoat Level 1
            Further efforts on my part have still yielded no success with this. The movie continues to work perfectly via 'Test Movie' but not when uploaded to the server. Incidentally, it would appear that the target mc is being replaced by something (because the target mc is mid grey, and in the uploaded version the mc disappears/turns white). But that something would appear to be either 'nothing at all' or some other form of null content.

            Any assistance would be hugely appreciated, because I can't see what the problem is.
            • 3. Re: external relative path problems
              Craig Anthony
              Be absolutely sure that you are publishing in flash 8 because anything else won't load pngs. Also be sure that you clear your browser cache.

              Another tip is to create a dymanic text field and write some trace statements to it - just so that you can see what is going on once it is viewed through a browser.
              • 4. Re: external relative path problems
                Rothrock Level 5
                Also paths to all external files are relative to the location of the html page, not the swf or any subsequently loaded swfs. So if don't have those two in the same folder that could be the source of your problem.
                • 5. Re: external relative path problems
                  ricklecoat Level 1

                  Although I'd worked out the solution earlier, you hit the nail squarely on the head -- thanks for your help. in fact, you also steered me away from a wrongful assumption; I had deuced that the path to the external files would be taken from the first (ie. non-nested) swf file, rather than the HTML page containing it. I'd reached this false conclusion because my html and swf files were sat side-by-side in the directory/folder. So it makes no difference in this particular set up, but would make a big difference should I have a different arrangement of files in a later project, and is very useful point to be clear on. Thanks for that.

                  Craig Anthony:

                  I am outputting as Flash8 as it happens, but I was unaware that png support was not available in earlier versions. Again, I got lucky on this one, but it's important information that will be valuable in later projects.

                  Thanks to both of you.
                  • 6. Re: external relative path problems
                    Rothrock Level 5
                    Glad that worked out for you. Also keep in mind that it is the same for projectors should you ever publish some of those. All paths are relative to the location of the projector, not any swfs that may get loaded into it.
                    • 7. external relative path problems
                      Hello guys and gals,

                      I just wanted to add, that after searching for quite a bit, I found this forum and my problem seems to be the same as the original poster. I am using JPEG files however. My movie loads, but the jpegs do not. All the files (the asp file, the swf file, all the jpegs) are in the same directory and everything is using a path relative to the root to avoid confusion. Again, the movie loads and the jpegs do not.

                      It works locally fine so long as I don't use a webserver to launch it (so I test on a standard HTML file). As son as I launch that same html file using http://localhost/etc it exhibits the same behavior as online, because essentially it is online, im using IIS. So it seems to be some problem with the webserver versus the local.

                      I am 100% proof positive the file locations are not the problem, but don't know what is.

                      edit: I forgot to mention that I am also using a loader component to accomplish the random, dynamic loading of these jpegs based on a frame that has actionscript running a Math.floor(Math.random)*10) and setting an if else flag scenario = to 1 of 11 jpegs.

                      so if the flag ==1, then loader.contentPath = "jpeg1.jpg" for example.

                      Thanks again!
                      • 8. Re: external relative path problems
                        Rothrock Level 5
                        Adding a slightly related, but not necessarily the same problem onto an already answered thread is probably not the best approach. :) In the future please start a new one.

                        A link to this would probably be the quickest way to figure it out.

                        Although when using a loader component who know what the problem might be.
                        • 9. Re: external relative path problems
                          Dread_Pirate_Pete Level 1
                          Ah, sorry my apologies. I am used to phpbb forums only, I didn't know of all teh features like "answered" etc. I will create a new thread. thanks.