0 Replies Latest reply on Jul 30, 2007 12:09 PM by redbarn03

    hitTest functionality-nav rollover, release doesn't work

    redbarn03
      Hello All-
      I'm still fairly new in working with Flash AS. I'm currently working
      on a file and am having some difficulty and was hoping someone might
      have some experience and could help me resolve my issue. Here goes:

      Overall structure: I have the main root timeline, movie. Within the
      main time line is a movie clip called main_nav_mc. That movie clip is
      made up of up four individual movie clips, for example, mag_nav_mc.
      Within mag_nav_mc I have a few layers to handle various graphic
      elements, etc. I also have an default, on and off state for that movie
      clip. Finally, I have another movie clip that acts as a basic nav
      button, called mag_subnav1_mc. What I'm trying to do is allow the user
      to rollover a nav item, have it animate and reveal the subnav for that
      particular section. Doesn't seem to hard and I had it working with the
      exception of the subnav items rollovers, and release functionality.

      Here's the basic code:

      this.onEnterFrame = function() {
      if (main_nav_mc.mag_nav_mc.hitTest(this._xmouse, this._ymouse, true))
      {
      main_nav_mc.mag_nav_mc.gotoAndStop("on");

      if (main_nav_mc.mag_nav_mc.mag_subnav1_mc.hitTest(this._xmouse,
      this._ymouse, true)) {
      main_nav_mc.mag_nav_mc.mag_subnav1_mc.gotoAndStop("on");

      main_nav_mc.mag_nav_mc.mag_subnav1_mc.onRelease = function() {
      getURL("", _blank);
      }

      } else {
      main_nav_mc.mag_nav_mc.mag_subnav1_mc.gotoAndStop("off");
      }

      main_nav_mc.mag_nav_mc.onRollOut = function() {
      main_nav_mc.mag_nav_mc.gotoAndStop("off");
      }
      }

      }

      The subnav items rollovers and rollouts are functioning, but the
      onRelease function will not perform. Any ideas how I can get this to
      work or simplify it would be greatly appreciated.

      Thanks
      Brian