1 Reply Latest reply on Aug 4, 2007 6:47 AM by kglad

    Accessing movieclip name for loadMovie() with a concatenated variable

    icer01
      Okay, I have a movie which generates a certain amount of movieclips [determined by a variable]. They are given the names mc_placeholder1 to mc_placeholderx.
      Later in the movie, I want to access each of these placeholder movieclips in turn to attach an image to them with movieName.loadMovie(). However, which of the placeholder movieclips is being accessed is determined by a variable, i. So, if i=3 I would want to attach to mc_placeholder3.

      Hard coding
      var movieName=mc_placeholder3;
      movieName.loadMovie(...)
      works, but anything to concatenate the movieclip name such as
      var movieName="mc_placeholder"+i;
      does not, I assume because it changes it to a string.

      How can I get it to perform .loadMovie on the movieclip named mc_placeholderi where i is the value of the variable?

      thank you