You can use blow code to get application URL:

*Flex4 Application:*

FlexGlobals.topLevelApplication.url

URLUtil.getServerName(URL);

OR

URLUtil.getServerNameWithPort(URl)

*If Flex3 Application then use: This will work in Flex4 also*

var applicationURl:String = ExternalInterface.call("window.location.href");



On Wed, Sep 2, 2015 at 8:20 PM, galapagos [via Apache Flex Users] <
[email protected]> wrote:

> I would like to know if it is possible to get the URL (or the domain) of
> the Flex application which calls a remote object, from that remote object.
>
> I have a Flex application which is accessed by different domains, and for
> each domain, the remote object must use a database whose name is the root
> of the domain name of the URL, such as 'sample1' if the remote object is
> called from the Flex application through URL 'sample1.mydomain.com/myapp',
> and 'sample2' if the remote object is called from the same Flex application
> through URL 'sample2.mydomain.com/myapp'
>
> I know I could use an argument that the Flex app could pass to the remote
> object, but this is legacy code and this would imply a huge amount of
> changes.
>
> If I could do it in the remote object which does the connection to the
> database, I would only have to change the getconnection call in that remote
> object.
>
> Please advise.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-flex-users.2333346.n4.nabble.com/get-url-or-domain-of-requesting-Flex-app-from-a-remote-object-tp11123.html
> To unsubscribe from Apache Flex Users, click here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tfDF8LTU0MTcyMzE2NA==>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
*Regards,*
Prashant Kumar* | *Mob.: +91 8408811225




--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/get-url-or-domain-of-requesting-Flex-app-from-a-remote-object-tp11123p11134.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to