6 Replies Latest reply on Jul 7, 2009 6:12 AM by Ned Murphy

    Add URL to a button

    SalvationD

      Alright I know this is gonna seem ridiculous, but I've done it a few times and something always goes buggar.. so using a button already made from a template the code is this:

       

       

      onClipEvent (load) {
           num = 5;
           link_num = _root.getMenuSystemOrder(num-1);
      }
      on (rollOver) {
           if (_root.link<>link_num) {
                this.gotoAndPlay("s1");
           }
      }
      on (releaseOutside, rollOut) {
           if (_root.link<>link_num) {
                this.gotoAndPlay("s2");
           }
      }
      on (release) {
           if (_root.link<>link_num and _root.animation == 1) {
                _root.animation = 0;
                _root.link_prev = _root.link;
                if (_root.link != _root.pagesReadMoreFrame) {
                     _parent["item"+_root.getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
                }
                _root.link = link_num;
                _root.play();
           }
      }
      
      I want to make this button instead of a link to a page inside of the flash, I want it to be a link to an outside URL. Ex: google.com. (While Keeping the animations and such) I dont understand all the root.link<> and pagesReadMore etc.  BTW I want the page to load in the browser, NOT inside the flash / frame.
      Thanks in advance!

       

       

       

      Edit: This template also uses an outside source of a XML file.  would it be possible to change the link in the XML for ease / future changes, or does it need to be done in the flash script?  This is the XML script: (Shortened)

       

       

      <link systemOrder="5"><![CDATA[
      <font face="standard 07_56">CONTACTS</font>
      ]]></link>
      

       

       

      -- Continued further down in XML: --

      <page name="CONTACTS">
      
      <texts>
      
      <pageText><![CDATA[
      
      ]]></pageText>
      
      </texts>
      
      </page>
      
      
      

       

      Message was edited by: SalvationD