3 Replies Latest reply on Jan 17, 2010 7:30 AM by kglad

    detecting clicks on multiple movieclips

    tom65536

      Hi,

       

      thanks for your time reading this.  I am struggling on figuring out how to detect clicks on various movieclips I am generating.   Basically I am allowing the user to attach an arbitrary number of instances of the same movie clip.   I would like each instance to A) be clickable and B) pass its reference to the click-handling routine.

       

      For example I have something like this:

       

      function addMissile() {

           this.attachMovie("missile", "missile"+mtop, this.getNextHighestDepth(), {_x:startx, _y:starty});

           activeMissiles[mtop]=_root["missile"+mtop];

           activeMissiles[mtop].focusEnabled = true;

           Selection.setFocus(activeMissiles[mtop])

           mtop++

      }

       

      I want to add a callback on-click for each of these movie clip instances.   Appreciate if someone can point me in the right direction

       

      Best Regards,

      Tom