8 Replies Latest reply on Jul 18, 2009 12:24 PM by kglad

    I can't add an onRelease to an attached movie clip

    optikalefxxxx

      Im pulling images from an xml file and I want to attach an onRelase and onRollOver event to each one, but it's not working

       

      var thumbWidth = 24;

      var thumbHeight = 24;

       

      var xml = new XML();

      xml.ignoreWhite = true;

      xml.onLoad = function(loaded) {

      if (loaded) {

      for(i=1;i<=6;i++) {

      var btn:MovieClip = holder_mc.attachMovie("thumb_mc","thumb_"+i+"_mc",i);

      btn._x = i*128 - 126;

      btn._xscale = thumbWidth;

      btn._yscale = thumbHeight;

      btn.onRelease = function() {

      trace("clicked");

      }

      btn.loadMovie(xml.firstChild.childNodes[i-1].firstChild.firstChild.nodeValue);

      }

      }

      };

      xml.load("lookbook.xml");

       

      I never get that trace

       

       

      Thanks!