Here is a function I put together to get the domain:
public function getDomain():String{
return (Application.application.url.substring(
Application.application.url.indexOf('//')+2,
Application.application.url.indexOf('/',Application.application.url.indexOf('//')+2)
));
}
At 10:49 AM 4/9/2007, John Kirby wrote:
I think I know the answer to this ... but hoping there is a better way.
I have an application which connects to various SOAP services
*outside* my application domain. No problem, I use a Proxy service
from my domain to handle it. However, like most application url's
.... I can launch via using <http://www.myhost.com>www.myhost.com or
myhost.com. The security sandbox looks at these as separate domains
when the Flex client tries to connect to the Proxy service. So to
get the correct domain from where the application was launched
(<http://www.myhost.com>www.myhost.com or myhost.com) I use a Java
servlet or PHP to actually launch the application. The server side
component passes the "correct" domain (based upon the HTTP request)
as a parameter to the SWF so it knows the "exact" domain name to use
when connecting to the proxy.
It seems there should be a better way to do this *without* having to
use a servlet/PHP on the server side?
Any ideas?
.j
--
Whether you think that you can, or that you can't, you are usually right.
- Henry Ford
--
Jeffry Houser, Software Developer, Writer, Songwriter, Recording Engineer
AIM: Reboog711 | Phone: 1-203-379-0773
--
My Company: <http://www.dot-com-it.com>
My Podcast: <http://www.theflexshow.com>
My Blog: <http://www.jeffryhouser.com>
Connecticut Macromedia User Group: <http://www.ctmug.com>