3 Replies Latest reply on Sep 14, 2006 7:31 PM by kglad

    Nested Movie Clip Mouse Clicks

    rtoepf
      Simple question: I have a movie clip nested inside another movie clip. If I create an onpress function for the outside movieclip I cannot capture mouse clicks for the inside movie clip. How can I do this? I've searched this forum and livedocs but can't seem to find anything. This is a simple problem so there has to be a simple solution.
        • 1. Re: Nested Movie Clip Mouse Clicks
          Rothrock Level 5
          That is because you can't. Every pixel of a child clip is also a pixel of the parent. Therefore the won't be any way for the child defined event to happen.

          The usual solution is to have more movie clips. Have a parent movieclip and then the two clips you are currently using would both be children of that container – not inside each other, but both just inside the parent container.

          There are probably lots of other solutions, but they tend toward complicated and also depend upon exactly what you are trying to do.
          • 2. Re: Nested Movie Clip Mouse Clicks
            rtoepf Level 1
            I ended up with the same solution. Funny how something so simple isn't mentioned in the documentation. Thanks for the help!
            • 3. Re: Nested Movie Clip Mouse Clicks
              kglad Adobe Community Professional & MVP
              actually, i think a simpler solution is to define a mouse handler for the parent and use a hitTest() between the child and mouse to determine if you want the child to respond to the mouse event or you want the parent to respond: