Generally you specify a full URL as the rootURL (perhaps the path to your SWF which is Application.application._url).  Say for example http://www.somewhere.com/dir/file.swf.

The urls would be computed as follows:

 

sub/bar.swf : http://www.somewhere.com/dir/sub/bar.swf

/sub/bar.swf: http://www.somewhere.com/sub/bar.swf

http://elsewhere.com/bar.swf: http://elsewhere.com/bar.swf

 

Make sense?

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jeroen De Vos
Sent: Thursday, May 19, 2005 4:22 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Fully qualified URL

 

Allen,

 

Yes, I read the doc, but what does it do? How does it work?

 

Jeroen.

 


Van: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] Namens Allen Manning
Verzonden: donderdag 19 mei 2005 13:22
Aan: flexcoders@yahoogroups.com
Onderwerp: RE: [flexcoders] Fully qualified URL

Joren,

 

According to the MXML API docs:

getFullURL
static  getFullURL( rootURL: String, url: String) :  String 

 

' Converts a potentially relative URL to a full qualified URL. If the URL is not relative, it is just returned as is. If the URL starts with a slash, the host and port from the root URL are prepended. Otherwise, the host, port, and path are prepended. ' 

 

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:flexcoders@yahoogroups.com] On Behalf Of Jeroen De Vos
Sent: 19 May 2005 12:14
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Fully qualified URL

Hi,

 

And what does mx.utils.URLUtil.getFullURL() do then?

 

Jeroen.

 


Van: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] Namens Allen Manning
Verzonden: donderdag 19 mei 2005 12:56
Aan: flexcoders@yahoogroups.com
Onderwerp: 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:flexcoders@yahoogroups.com] 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:flexcoders@yahoogroups.com] 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

Reply via email to