5 Replies Latest reply on Jan 26, 2007 6:15 PM by kglad

    links in ActionScript

    dubeld
      I want to link a banner in a way that enables me to change the destination link independently and not imprint it in the file..
      I got this far:
      on (press,release) {

      getURL(" http://________.com/","_blank") ;

      Want do I need to add/change in order to make the URL generic?

      THANKS
        • 1. Re: links in ActionScript
          kglad Adobe Community Professional & MVP
          you can use a variable to store the url:

          • 2. Re: links in ActionScript
            dubeld Level 1
            I'll try to explain my self better maybe imp missing something...
            We are talking about a banner, and I am looking for a code that go's to a outside server and get's the URL from there without touching the actually flash every time… just update the server… and in that way the banner can be displayed and I can indepndtly redirect the user to where ever I want…
            You solution, unless I missed something' still keeps me dependent on the flash..
            I need : "urlVar=www.adobe to be out said
            • 3. Re: links in ActionScript
              kglad Adobe Community Professional & MVP
              the variable name/value can be retrieved from a file external to your swf. for example, you can load a variable name/value pair from a text file. though, if the text file is outside the domain containing flash you'll need a cross-domain policy that allows you to load the text file from another domain
              • 4. Re: links in ActionScript
                dubeld Level 1
                so if i got this, in the server i have to have an cross-domain policy like:
                <?xml version="1.0"?>
                <!-- http://www.foo.com/crossdomain.xml -->
                <cross-domain-policy>
                <allow-access-from domain="www.______.com" />

                </cross-domain-policy>

                and what do i say in the flash?
                • 5. Re: links in ActionScript
                  kglad Adobe Community Professional & MVP
                  1. your xml cross domain policy should list the domain that you want to grant access in place of your "www.____.com"

                  2. you can specify the location of this xml file in flash using System.security.loadPolicyFile(" http://www.foo.com/crossdomain.xml");

                  3. you can now use LoadVars(), for example, to load a text file from somewhere in www.thecrossdomain.com that contains the variable/value you want.