2 Replies Latest reply on Jul 12, 2007 5:59 AM by Newsgroup_User

    Buttons inside draggable content

    lukeduke7 Level 1
      I have a button that when clicked makes a movie visible. That movie is draggable. I have a button inside that movie that I want to close or "hide" the movie. For some reason it doesn't seem to recognize the button in the movie, it seems to recognize everything as the draggable content. My question is, how can I get buttons to work inside draggable content?

      I was told to try hitTest() but don't know much about it. After hours of reading about it I couldn't get a grasp of how it would help my situtation. Most of the tutorials and information was directed toward situtions involving boundries or collision movements of objects.

      Question: How can I get buttons inside a movie that is draggable to work and be recognized as buttons? Is hitTest the answer and if so, is there an example of how to use it in my situation?

      Below is what I have for code so far. I have also provided a link of what I am trying to achieve.

      LINK: (click skip to skip video)
      http://www.hp.com/personalagain/us/en/shaun_white.html

      Thanks in advance for any ideas or information! It will be greatly appreciated!
      Luke
        • 1. Re: Buttons inside draggable content
          SymTsb Level 2
          This is an issue of nested buttons. As long as you have a movie clip with an event handler attached to the entire mc, you won't be able to access the actions underneath it. You can do hit tests to check when the mouse is over the button but that gets difficult when the content containing the button is draggable and as such will follow the mouse around the screen.
          • 2. Re: Buttons inside draggable content
            Level 7
            Instead of making the clip itself draggable, create an invisible button
            the same size as the clip to be dragged and place it in a layer below
            the close button.

            Now you have a draggable clip that will drag from any point except the
            close button.