3 Replies Latest reply on Jul 20, 2006 5:36 AM by Newsgroup_User

    attachMovie only showing last one in loop

    Level 7
      Hi All,

      I really need some help with dynamically attaching some mc's.

      I have some pictures loaded by code on layer: pics. they load great.

      On layer 2:targets I have code to load other mc's as a target to
      dragndrop the pics into. In the library I have an mc with the link name
      'targetmc'. It is a nice border to act as a target.

      The problem is that the target mc's only show one box (the last box, in
      the last position) instead of all of them in a row. the targetmc
      movieclip is a fancy border to outline each pic, and only the last one
      in the loop is shown, the other spaces being blank.

      target code:

      for (var a:Number=1; a<4; a++ ){ //loop to load 3 pictures

      //attach targetmc and give each one the name tgt1, tgt2,
      var mctg:MovieClip = this.attachMovie("targetmc", "tgt" + a, 1);
      //position each one in a row -
      //(border+(half width)) + (no of image) X (image
      mctg._x=(10+(mctg._width*.5)) + (a-1)*(10 + 111.55);
      trace(mctg._name); //just to see how many mc's were
      attached - result =
      //tgt1, tgt2, tgt3 - all
      three are loading.

      Any ideas greatly appreciated,

      Jeff C.