And I added ContextRoot.
Tracy
<?xml version="1.0"
encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:String
id="sContextRoot">@ContextRoot()</mx:String>
<mx:Script><![CDATA[
private function
getPageURL() : String
{
return(mx.core.Application.application._url);
}
private function
getPageDomain() : String
{
var
myArray:Array = getPageURL().split("/");
var
domain = myArray[2].toString();
return(domain);
}
private function
getFullContextRoot():String
{
return
"http://" + getPageDomain() + sContextRoot;
}
]]></mx:Script>
<mx:Panel title="Get This
URL" width="100%" height="100%">
<mx:Label
text="{getPageURL()}"/>
<mx:Label
text="{getPageDomain()}"/>
<mx:Label text="http://{getPageDomain()}/"/>
<mx:Label
text="{sContextRoot}"/>
<mx:Label
text="{getFullContextRoot()}"/>
</mx:Panel>
</mx:Application>
From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Allen Manning
Sent: Thursday, May 19, 2005 6:56
AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Fully
qualified URL
Jeff,
Thanks.
<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Panel title="Get This URL"
width="100%" height="100%">
<mx:Script><![CDATA[
private function getPageURL() : String
{
return(mx.core.Application.application._url);
}
private function getPageDomain() : String
{
var myArray:Array = getPageURL().split("/");
var domain = myArray[2].toString();
return(domain);
}
]]></mx:Script>
<mx:Label text="{getPageURL()}"/>
<mx:Label
text="{getPageDomain()}"/>
<mx:Label text="http://{getPageDomain()}/"/>
</mx:Panel>
</mx:Application>
Allen
|
Allen Manning, Technical Director
|
Prismix
Ltd t:
+44 (0)870 749 1100 f: +44 (0)870 749 1200 w:
www.prismix.com
|
|
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf
Of Jeff Tapper
Sent: 19 May 2005 11:52
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Fully
qualified URL
Ugggh. _root -- bad.
in the example below, since its running in the
core application tag, you
can just remove the word _root entirely, and it
will still work, or, as
Abdul suggested,
mx.core.Application.application._url will work from any
place in the app.
At 06:43 AM 5/19/2005, you wrote:
>Hello Jeroen,
>
>Below is an example of one way of doing it.
>
><?xml version="1.0"
encoding="utf-8"?>
><mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
> <mx:Panel
title="Get This URL" width="100%"
height="100%">
>
<mx:Script><![CDATA[
> private function
getPageURL() : String
> {
> return(_root._url);
> }
>
> private function
getPageDomain() : String
> {
> var myArray:Array =
getPageURL().split("/");
> var domain =
myArray[2].toString();
> return(domain);
> }
>
>
]]></mx:Script>
>
>
<mx:Label text="{getPageURL()}"/>
>
<mx:Label text="{getPageDomain()}"/>
>
<mx:Label text="http://{getPageDomain()}/"/>
>
> </mx:Panel>
></mx:Application>
>
>HTH,
>Allen
>
>Allen Manning, Technical Director
>Prismix Ltd t: +44 (0)870 749 1100 f: +44
(0)870 749 1200 w: www.prismix.com
>
>
>
>
>
>
>
>
>From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
>Behalf Of Jeroen De Vos
>Sent: 19 May 2005 11:28
>To: flexcoders@yahoogroups.com
>Subject: [flexcoders] Fully qualified URL
>
>Hi all,
>
>In ActionScript I need to read the fully
qualified URL to the application
>(http://xxxxx/xxxxx/…).
>How can I get this URL?
>
>Jeroen.
>
>________________________________
>
>Jeroen De Vos
>Gemeentelijk Havenbedrijf Antwerpen
>C/ICT - AMARIS
>________________________________
>
>Deze e-mail en alle gekoppelde bestanden zijn
officiele documenten van het
>Gemeentelijk Havenbedrijf Antwerpen en kunnen
vertrouwelijke of
>persoonlijke informatie bevatten. Gelieve de
afzender onmiddellijk via
>e-mail of telefonisch te verwittigen als u
deze e-mail per vergissing
>heeft ontvangen en verwijder vervolgens de
e-mail zonder deze te lezen, te
>reproduceren, te verspreiden of te ontsluiten
naar derden. Het
>Gemeentelijk Havenbedrijf Antwerpen is op geen
enkele manier
>verantwoordelijk voor fouten of
onnauwkeurigheden in de inhoud van deze
>e-mail. Het Gemeentelijk Havenbedrijf
Antwerpen kan
niet aansprakelijk
>gesteld worden voor directe of indirecte
schade, verlies of ongemak
>veroorzaakt als gevolg van een onnauwkeurigheid
of fout in deze e-mail.
>
>English Translation: This e-mail and all
attached files are official
>documents of Antwerp Port Authority and may
contain confidential or
>personal information. If you have received
this e-mail in error, you are
>asked to inform the sender by e-mail or
telephone immediately, and to
>remove it from your system without reading or
reproducing it or passing it
>on to other parties. Antwerp Port Authority is
in no way responsible for
>any errors or inaccuracies in the contents of
this e-mail, nor can it be
>held liable for any direct or indirect loss,
damage or inconvenience
>arising from any such errors or inaccuracies.
[GHA#Disclaimer]
>
>
>Yahoo! Groups Links
>To visit your group on the web, go to:
>http://groups.yahoo.com/group/flexcoders/
>
>To unsubscribe from this group, send an email
to:
>[EMAIL PROTECTED]
>
>Your use of Yahoo! Groups is subject to the
Yahoo! Terms of Service.
Yahoo! Groups Links