0 Replies Latest reply on May 9, 2007 6:53 PM by idellej

    HitTest - Using to control a different MovieClip

    idellej
      I am trying to have a animated rollout sub-menu for a menu, and figured using the onClipEvent / hitTest code would work well. My dilemna is that I want the menu rollout to include a fading in of a full screen photo, so I added the animation of the photo to the menu's movieclip. However, once the photo fades in, it is then part of the MovieClip hitTest area, so it won't let the mouse "rollout" of the movieclip (as the mouse is always over the photo, which takes up the whole flash area).

      I came up with two possible solutions to solve the problem, but I need help with the coding:

      1. Is there a way to define the hit area specifically to be just the menu part of the MovieClip (and disregard the space area that the photo occupies)?

      or

      2. Move the Photo animation into it's own MovieClip and then use the hitTest code to call the photo's MovieClip and tell it to do the same thing. Is this possible? This seems the better solution if doable.

      Here's my attempt at coding this second option - but it doesn't work when I test it. Any ideas on how to make it work? The MovieClip of the photo animation has an instance name of "DiningRoom".

      Here is the (nonworking) code:

      onClipEvent (enterFrame) {
      if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
      this.nextFrame();
      } else {
      this.prevFrame();
      }
      }

      onClipEvent (enterFrame) {
      if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
      this.DiningRoom.nextFrame();
      } else {
      this.DiningRoom.prevFrame();
      }
      }



      Thanks for any help!