2 Replies Latest reply on May 22, 2007 6:00 AM by dfm_

    URL link with Flash

      Hi,

      I wanted to create a button in Flash (invisible button) that is linked to a URL, but I want to be able to change the URL anytime I want. I've try using xml but somehow it's not working..Is there other way to do this?

      Thanks
        • 1. Re: URL link with Flash
          Level 7
          there are many ways

          1. Can store address in txt file.
          2. can use JavaScript
          3. can use xml
          4. can use a database

          "aenie09" <webforumsuser@macromedia.com> wrote in message
          news:f2u0s4$1vp$1@forums.macromedia.com...
          > Hi,
          >
          > I wanted to create a button in Flash (invisible button) that is linked to
          > a
          > URL, but I want to be able to change the URL anytime I want. I've try
          > using xml
          > but somehow it's not working..Is there other way to do this?
          >
          > Thanks
          >


          • 2. Re: URL link with Flash
            dfm_ Level 1
            put .swf and .xml in the some folder.

            you XML code is:
            <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
            <root>
            <goHere url="http%3A%2F%2Fwww%2Eyahoo%2Ecom%2F">
            </root>

            http%3A%2F%2Fwww%2Eyahoo%2Ecom%2F is actually http://www.yahoo.com/. Why look more about escape and unescape.

            AS code is sth like this:

            stop();
            var urlAdress:String = new String();
            var myXML:XML = new XML();
            myXML.ignoreWhite = true;
            myXML.onLoad = function(success:Boolean) {
            if (success) {
            urlAdress = myXML.firstChild.firstChild.attributes["url"];
            urlAdress = unescape(urlAdress);
            gotoAndStop(_root._currentframe+1);
            } else {
            error_txt.text = "missing .xml file";
            }
            };
            myXML.load("myXML path");

            your url adress mus be in urlAdress