Posted by sortofme on October 28th, 2008
I often cam across the issue, especially when working with XML data, that I want to pass on many of the paths used for loading XML or other tyoes of media from the embedding source, rather than hard coding it into my swf. That is fine, but I always run into the problem, that during development, the paths actually used on the server are wwuite unhandy for my IDE development.
Thats why I document here how I usually handle this, by checking whether the file is being served from local, or whther it is on a server:
Actionscript:
-
if(stage.loaderInfo.url.indexOf("file:") != -1){
-
trace("Local");
-
_XMLPath ="album1.xml"
-
}else {
-
_XMLPath = root.loaderInfo.parameters.imageXMLPath;
-
trace("Server");
-
}
Recent Comments