To all those trying to test loading of data from relative paths locally,
here's a little secret I've learned.
At least with Flash 8, the Flash IDE stores the path of the last file opened
and treats it like the server root.
Let's say you have a local environment with two main directories, a source
directory and a deploy directory.
- source/
main.fla
- subdirectory/
secondary.fla
- deploy/
main.swf
- subdirectory/
secondary.swf
- xml/
data.xml
The source file source/main.fla publishes to deploy/main.swf. The source
file source/subdirectory/secondary.fla publishes to
deploy/subdirectory/secondary.swf.
Both main.swf and secondary.swf load an xml file from the path
/xml/data.xml.
If you open the file secondary.fla within the Flash IDE and test the movie
using CTRL+ENTER, the published file secondary.swf will not be able to
locate the file /xml/data.xml, because the FlashPlayer will search from the
path source/subdirectory/.
However, if you then open deploy/main.swf from within the Flash IDE, the
opened file main.swf will be able to locate the file /xml/data.xml, because
the FlashPlayer will search from the path deploy/, treating it as if it were
a server root.
Now if you switch tabs back to secondary.fla and test again using
CTRL+ENTER, the published file secondary.swf will be able to locate the file
/xml/data.xml, because the FlashPlayer will search from the path of the last
file opened, deploy/.
I hope someone finds this useful. It's been a real timesaver for me. I
used to rely on branching for System.capabilities.playerType, but with more
complex projects and directory structures it became unmanageable.
Cheers,
Michael
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com