3 Replies Latest reply on Aug 16, 2007 9:07 PM by kglad

    AS3 - Accesing dynamic MC

    Level 7
      Hello,

      From a Thread in this forum, I learned to create dynamic MC like this:

      for (var i:int=0; i<5; i++) {
      var mc:MovieClip = new MovieClip();
      mc.name = "thumb_"+i;
      mc.myNumber = i * i;
      this.addChild(mc);
      trace(mc.name+", "+mc.myNumber);
      }

      results:

      thumb_0, 0
      thumb_1, 1
      thumb_2, 4
      thumb_3, 9
      thumb_4, 16

      but if I want to trace a myNumber from a previous MC, i don't know how
      to do it:

      trace(mc.myNumber);
      trace(this.thumb_2);

      results:

      16
      undefined

      How can I do this? Is thumb_2 deleted by thumb_3, and thumb_3 deleted by
      thumb_4?

      regards.
      Hugo Hiram.