5 Replies Latest reply on Sep 15, 2009 11:26 AM by Tical84

    Coding Confusion: Links linking to wrong...links

    Tical84

      Hi everyone,
      I'm writing some code in Flash MX 2004 and everything works fine except for the last button (4DSystemsProducts). According to the coding if none of the drop down buttons work it should go to products.php, but for some reason it goes to 4DSystemsProducts.php. All of the other menus are coded the same way and work fine, if I take out that button it works fine, or if I take out button 7 and switch 4DSystems to button 7 everything works.
      Here is the code to clear up this explanation.

      [CODE]

      function getActiveSub()
      {
          if (_ymouse >= 38 && _ymouse < 58)
          {
              return (activeButton.btnSub1);
          }
          else if (_ymouse >= 58 && _ymouse < 78)
          {
              return (activeButton.btnSub2);
          }
          else if (_ymouse >= 78 && _ymouse < 98)
          {
              return (activeButton.btnSub3);
          }
          else if (_ymouse >= 98 && _ymouse < 118)
          {
              return (activeButton.btnSub4);
          }
          else if (_ymouse >= 118 && _ymouse < 138)
          {
              return (activeButton.btnSub5);
          }
          else if (_ymouse >= 138 && _ymouse < 158)
          {
              return (activeButton.btnSub6);
          }
          else if (_ymouse >= 158 && _ymouse < 178)
          {
              return (activeButton.btnSub7);
          }
          else if (_ymouse >= 178 && _ymouse < 198)
          {
           return (activeButton.btnSub8);
          }
          else
          {
              return (null);
          } // end else if
      } // End of the function
      var activeButton;
      var activeSub;
      btnProducts.onRollOver = function ()
      {
          btnProducts.gotoAndPlay("drop down");
          activeButton = btnProducts;
          activeSub = null;
      };
      btnProducts.onRollOut = btnProducts.onReleaseOutside = function ()
      {
          btnProducts.gotoAndPlay("drop up");
          activeButton = null;
          if (activeSub != null)
          {
              activeSub.gotoAndPlay("stoparrow");
          } // end if
          activeSub = null;
      };
      btnProducts.onRelease = function ()
      {
          if (activeSub == btnProducts.btnSub1)
          {
              getURL("products.php");
          }
          else if (activeSub == btnProducts.btnSub2)
          {
              getURL("newreleases.php");
          }
          else if (activeSub == btnProducts.btnSub3)
          {
              getURL("controlgrips.php");
          }
          else if (activeSub == btnProducts.btnSub4)
          {
              getURL("joysticks.php");
          }
          else if (activeSub == btnProducts.btnSub5)
          {
              getURL("controlboxes.php");
          }
          else if (activeSub == btnProducts.btnSub6)
          {
              getURL("electronics.php");
          }
          else if (activeSub == btnProducts.btnSub7)
          {
              getURL("accessories.php");
          }
          else if (activeSub == btnProducts.btnSub8)
          {
              getURL("4DSystemsProducts.php");
          }
          else
          {
              getURL("products.php");
          } // end else if
      };
      [/CODE]