5 Replies Latest reply on Nov 19, 2009 12:29 PM by kglad

    use a dynamically created movieclip

    virusg_a_g

      Seems that after I get over one problem the other one is just around the corner. That's what makes it exciting I guess

       

      I have a function that appends 7 movieclips to the timeline in a loop. The name of the clips is generated automatically:

       

      menu = function(){
           
           var tFiles:Number = myXML.firstChild.childNodes.length;
           for (me=0; me < tFiles; me++){
           path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
           i++;
           _root.attachMovie("circle", "circle"+me, me, {_x:(me*43), _y:330});
           mclm.loadClip(path, ("circle"+me));     
           mclm.addListener(mclmL);     
           }
           
      }
      
      

      Now I want to use circle1, circle2.... etc in a function that has an 'i' variable.

       

      In the function I put

       

      MovieClip("circle"+i)._alpha = 0;
      

       

      It does not work. If I just use circle1 in the line it works perfectly.

       

      I hope there is a way of doing it without getting arrays involved.

       

      Thank you.