I'm having difficult time solving an absolute/relative path issues.
When using as3 and embed my swf via swf object JS, one of the parameters that being transferred to the embed JS function is "base=http://www.mydomain.com" which needed in order to load external widget into application.
Now, am also loading external assets like Styles.swf that placed locally on client side, and when I'm trying to load these assets I get error that they don't found in http://www.mydomain.com/.
For example:
StyleManager.loadStyleDeclarations("Styles.swf");
Error:
can't load http://www.mydomain.com/Styles.swf
Is it possible somehow to load Styles.swf as local assets??? I've tried use
StyleManager.loadStyleDeclarations("../Styles.swf");
StyleManager.loadStyleDeclarations("./Styles.swf");
StyleManager.loadStyleDeclarations("/Styles.swf");
But none of them works...开发者_StackOverflow
Thanks
If the base is http://www.mydomain.com
, I think you're stuck with that (so relative URLs are relative to that location).
You can get the current SWF URL to through Application.url
to resolve your URL directly (also see references to ExternalInterface
and BrowserManager
in this SO question).
精彩评论