I'm working on a news video player, involving loading of popup flash ads. This particular flash ad that I'm having trouble with is loaded from the same domain, only from several folders deeper.
The ad is being loaded in a SWFLoader object and works great. It's supplied by a creative company via our client, so I'm not familiar with its code. So we have a finished fact and here's the deal:
They gave us the SWF ad along with a number of .mp3-s. Logic advises it will search for the sounds relative to itself (http://domain.com/campaign/adtype), but instead the sounds are loaded from our app's root folder (http://domain.com). Imagine sounds for a number of ad campaigns cluttering the root folder. Again, I don't know how the ad was coded.
So, who is loading the sounds? Our app/loader or the ad itself? Can we somehow fix the sounds to load from the ad's root folder, or do we have to contact the ad makers to fix their references?
Unfortunately, in Flash, relative paths are always relative to the first SWF loaded, not the SWF making the request. In Flex, SWFLoader fixes up relative paths for you, but pretty much everyone else has to do it themselves.
The ad code needs to change or you need to put the mp3s in the root. Or make another domain for the ads and load them cross-domain.
Flex SDK Developer
Adobe Systems Inc.
I would have them simply create an API, which then you can set a path without changing the location of your main SWF. Perhaps the API can have, two methods: getSoundSubDirectory and setSoundSubDirectory.