views:

250

answers:

1

Hello,

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...

Thanks

+1  A: 

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).

Michael Brewer-Davis
Application.url will return the url which form there the application was loaded, I don't think its related to the problem, or ether the ExternalInterface. There must be a way to get this "base" parameter inside FLEX, just can't find it yet...
FLEXpert