3 Replies Latest reply on Sep 29, 2006 8:00 AM by kglad

    Dynamically creating a movieclip name

    Sivakanesh Level 1
      I have a series of tiny movieclips (about 100 of them, cannot be created at runtime) already exisit in my main movie.
      These have been name from A1 to A100. I have to refer to one of these movieclips depending on a value calculated at runtime from 1 to 100. I don't want to use a switch & case statment, because there would be too many of them.
      How can I create a movieclip variable in AS and assign one of the existing movieclips as the actual object?
      For example I tried:
      var MCobj:MovieClip = "A" + calculatedNumber;
      But this does not create a valid reference to the existing MC. Any ideas?