3 Replies Latest reply: May 29, 2012 5:05 AM by Ned Murphy RSS

    Play a movieclip as element of an array

    Tomek74

      Hi.

       

      I'm learning (and trying to work with) as3, and have a problem:

      how can i play a movieclip, which is an element of an array?

       

      Code like this:

       

      var mc:Array = new Array();

       

      for(var k=0;k<=4;k++) {

           mc[k] = new MovieClip;

           addChild(mc[k]);

          

           var addAnim:MovieClip = new anim();  // class from a package, to add clip from library

           mc[k].addChild(addAnim);                  // add clips, which to be played

       

      }

       

      // first frames of child clips appears correctly

       

      mc[0].play();  // nothing happens, no errors...

       

      What do i wrong?