Sorry the title had to be so long!
I created a slideshow which reads in an xml file that contains a list of image filenames and then randomly selects an image to show next. I don’t want all of these files in the root of my website, so I was hoping to contain everything related to the project in a subfolder.
Perhaps it’s because I’ve only been working in Flash for a few weeks, but I am having a terrible time trying to get my swf embedded into an html document. I know that the problem is with my external files because everything works fine if I dump it all into the website root. I have read that the swf takes on the path of the html page that it is embedded in, so I tried everything I could with relative/absolute paths but nothing worked.
To help clarify this issue, I will try to describe my understanding of it below:
For example, I have a website called (abc.com) with an index file and a subfolder:
abc.com/index.htm
abc.com/slideshow
My Flash project when published consists of these files:
slideshow.swf
slideshow.xml
AC_RunActiveContect.js
photo1.jpg
photo2.jpg
So I save my project files under (abc.com/slideshow) and the file paths are now:
abc.com/slideshow/slideshow.swf
abc.com/slideshow/slideshow.xml
abc.com/slideshow/AC_RunActiveContent.js
abc.com/slideshow/photo1.jpg
abc.com/slideshow/photo2.jpg
I embedded the slideshow.swf file by copy/pasting the code in the html file which was generated by Flash when I published the project. Then I made changes to some of the html:
<script src=“slideshow/AC_RunActiveContent.js” … >
<param name=“movie” value="/slideshow/slideshow.swf" … >
<embed src="/slideshow/slideshow.swf" … >
When I embed the slideshow.swf file into the index.htm file, it takes on a new working path of (abc.com/slideshow.swf) instead of the actual file path of (abc.com/slideshow/slideshow.swf). At least this is what I understand is supposed to happen. So when I reference an external file in Actionscript, say slideshow.xml, I must use the path (slideshow/slideshow.xml). For example:
Loader.load(new URLRequest(“slideshow/slideshow.xml”));
But it just doesn’t work.