0 Replies Latest reply on Jul 16, 2007 6:28 AM by DCI_Burnside

    AS 3.0 Using dynamically named mc from library

    DCI_Burnside
      Hi guys,

      I've got attaching movieclips from the library down in AS 3.0 in this manner

      var myMCInstance = new MCNamedInLibrary();
      holder.addChild(myMCInstance)

      but how would i got about using a dynamically named MC from the library in a manner and concat it down like this["piece"+1] for referencing from the library.

      function addPiece( pieceName_str )
      {

      //old as 2.0
      this.attachMovie(pieceName_str,pieceName_str,depth++);
      //new as 3.0
      this.addChild(new [pieceName_str](); // need to concat in right manner

      }

      this.addPiece("greenPiece_mc");

      any help would be much appreciated

      cheers