# Embed swf in html with external files in subfolders

**URL:** https://forum.kirupa.com/t/embed-swf-in-html-with-external-files-in-subfolders/272681
**Category:** Uncategorized
**Created:** [October 7, 2008, 4:48pm UTC](https://forum.kirupa.com/t/embed-swf-in-html-with-external-files-in-subfolders/272681 "2008-10-07T16:48:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hectavex](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@hectavex](https://forum.kirupa.com/u/hectavex)
#### Post date: [October 7, 2008, 4:48pm UTC](https://forum.kirupa.com/t/embed-swf-in-html-with-external-files-in-subfolders/272681/1 "2008-10-07T16:48:00Z")

</div>

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](http://abc.com)) with an index file and a subfolder:

_[abc.com/index.htm](http://abc.com/index.htm)  
 [abc.com/slideshow](http://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](http://abc.com/slideshow)) and the file paths are now:

_[abc.com/slideshow/slideshow.swf](http://abc.com/slideshow/slideshow.swf)  
 [abc.com/slideshow/slideshow.xml](http://abc.com/slideshow/slideshow.xml)  
 [abc.com/slideshow/AC\_RunActiveContent.js](http://abc.com/slideshow/AC_RunActiveContent.js)  
 [abc.com/slideshow/photo1.jpg](http://abc.com/slideshow/photo1.jpg)  
 [abc.com/slideshow/photo2.jpg](http://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](http://abc.com/slideshow.swf)) instead of the actual file path of ([abc.com/slideshow/slideshow.swf](http://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.
