Bah. Sorry to necropost.
Anyway, _url gives the absolute path, including the swf file. So it might be http://www.somesite.com/flash/myflash.swf
Now, if myflash.swf was embeded in www.somesite.com/main/user666/default.asp
, any url's specified in lang.load would be based on that path: that is to say, lang.load("../menuInfo.txt") would load www.somesite.com/main/menuinfo.txt
Let's say menuinfo.txt is located on the actual root (http://www.somesite.com/menuinfo.txt)
, and the flash that accesses it shows up all over the damned place (at varying levels, relative to the root).
What I want is to specify "one level above the swf's location", which (since the flash is at www.somesite.com/flash/
would point to the root). I could do this I suppose by taking the _url constant and cutting off /flash/myflash.swf, but this strikes me as fairly brute force. What if I renamed the directory, for example? Alot of pages may have similar structure, but different names, and I want my code to be reusable with the minimum changes. Is there an elegent way to use _url to perform relative pathign from the swf's location (rather than from the page displaying the swf's location), without resorting to just outright parsing it?