1 Reply Latest reply on Jul 3, 2006 5:07 AM by blemmo

    Find the clicked movie clip

    jgeorg
      Hi all,
      I have a movie clip containing about 200 other movie clips. I want to write a fuction that returns the name of the clicked movie clip. Ofcourse iI want to avoid to write 200 separate handlers for each movie clip. Any clever idea?
      Thanx in advance
        • 1. Re: Find the clicked movie clip
          blemmo Level 1
          Without any handlers, you would need to do a hittest for the mouse position with every MC instance to get the clicked MC. This isn't very nice, because it would have to loop through the instances every time a click occured. Maybe it's better to assign a handler to each MC in a loop, that returns the instance name or something like that. See attached code; note that it will assign the event to *every* MC in _root.

          hth,
          blemmo