4 Replies Latest reply on Nov 27, 2007 12:21 AM by Greg Dove

    calling an instance within an instance

    pandxsg
      Hi,

      I've got 3 movieclip buttons with instance name, "btn1", "btn2" and "btn3". Inside these clips is another movieclip named "mousedetect".

      How do I use a loop on the "mousedetect" movieclip to initiate an action? Without a loop it will look like this:

      btn1.mousedetect.onRelease=functiion(){
      btnRelease();
      }

      I've tried something like:

      for (i=1;i<=3;i++){
      this["btn"+i].mousedetect.onRelease=function(){
      btnRelease();
      }
      }

      but an error shows up, what should be the correct syntax?

      Thanks!