3 Replies Latest reply on Jul 26, 2007 2:50 PM by kglad

    Dynamic movieclip creation from library

    Rrrrrrrrrk
      Version: Flash CS3, AS3

      To add a new movieclip to the stage from the library you can do something like this:

      var newMC:libraryMC = new libraryMC();
      this.addChild(newMC);

      To do this, however, I need to know the name of the library movieclip beforehand (in this case, libraryMC). What do I do when I only receive the name at runtime?
      ie:

      randomMC = "libraryMC";
      ...?

      In AS2, you could use this.attachMovie(randomMC,"newMC",x), but that is no longer supported in AS3.
      So how is this situation handled now?

      Thanks
      Rick