Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SWF reading from different directories problem 1

Status
Not open for further replies.

dmacster

Technical User
Jan 28, 2005
670
US
I don't know if that's quite the description, but basically I have an swf that uses an xml file to read from a directory of images for a slideshow. Works fine on the normal page, but the company that runs this site has pages in several different directories, updates them all manually, and the swf does NOT appear on anything that isn't in the root directory.

Works here

But if the swf is in just get a white box.

Is there a fix for this? Don't really want them to have to duplicate the image folder, swf, and xml in every directory they use.

Ideas please?

thanks,
Donna
 
Sorry to be unclear. It's actually not another domain, just a different directory within the same domain. The swf is in the root directory of the domain, but some of the pages that will use the swf are in different directories, and that's where I can't get the movie to work.

thanks,
donna
 
Once embedded in the HTML document, relative paths to files you set in your Flash movie will be based on the hosting HTML document's location, not the location of the SWF. Sounds like you're talking about this?

Kenneth Kawamoto
 
Yup - that's what I'm talking about. Just doesn't work, though. Right now the swf and xml file are in the directory root, with the images in a separate directory. Works fine on the pages in the root, but not subdirectories. I'm wondering if I should put the swf and xml in a directory of its own with a subdirectory within the flash directory for the images (they will change weekly). Does that sound reasonable?

thanks,
donna
 
You can place your files anywhere you like, but you have to tell your Flash movie where they are correctly. When you are authoring a movie, paths to files are relative to the movie. But when the movie is running in the HTML, paths are treated as relative to the HTML.

There are two ways to solve this issue. The first one is to use "base" parameter(/attribute) in the Object(/Embed) HTML tag. If you set it to "." the paths in the SWF will be treated as relative to the SWF movie.

The other method (what I use) is work out the SWF location using loaderInfo.url (_url in AS1/2) and create paths based on that. This is more elegant solution.

Kenneth Kawamoto
 
Thanks, Kenneth. I'll look into the latter and see if I can figure it out.


donna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top