This content has been marked as final. Show 4 replies
I'm not sure there is a standard way, we use an approach similar to yours where
we parse the url where we were served from. For launching from
Flex builder we just added a bit of logic to use an standard url if we get the file path.
We also externalize other urls we need in a xml file that we deploy to the web server. So we parse the url that the app was served from. Fetch the xml file and use those url's for other processing.
Also you can always deploy to your local web server and still debug. That is what I do so I always see any sandbox errors. You just need to change the launch config to point to a server url instead of the ffile url
One approach I have used is to specify the url in the HTML wrapper file and pass it in as a flashvar.
This is avoids the Flex Builder problem.
Thanks for the replies, gents! I'll give these approaches a shot. Tracy, one note -- since my deployment artifact is actually a WAR file (Java webapp), inside of which both the flash swf and the html file sits, using a flash var is essentially the same situation I'm experiencing now -- rather than having to change Actionscript code to accommodate deploying to a different host, I'd have to change the Flash var value. Different file, but still a code change.
Ideally, I was hoping that there would be some standard application property exposed which would produce the host + application root which could then be used by all HTTP requests -- seems logical, a flash app making requests is typically going to be requesting from the host it came from. Parsing the Application URL is pretty close, so I'll probably go that route.
Thanks again for the responses.