anudda Flash MX one

  • Started
  • Last post
  • 1 Response
  • jgjh151

    I have a fla where I need to tell 50 different movie clips to do the same
    thing when the movie starts. Basically, I'm setting all their RGB to a
    given value. I want to do it in a way that I can put all their names in a
    list of some sort, then using that list to talk to them all. The other/LONG way would be
    to tell them each individually.

    Here is my script:

    //define the states UP colors variable
    statesUpColor = "0xffffff";
    //set the states UP color
    statesUpColorObject = new Color(_root.AK, _root.AL, _root.AR);
    statesUpColorObject.setRGB(state...
    //putting
    their names in like this doesn't work for me

    The long way would be this script, but only one movieclip referrenced (
    _root.AL). And write it 50 times, just with the new movie clip name in it?

    Thank you!!

  • o0o0

    Are all 50 mc's actually on the stage? Or are you using duplicateMovieClip?

    Either way a loop is what you need. If you actually have 50 mc's on the stage, you should name them "myclip0", "myclip1" ... etc

    then your code would look like:

    for(i=0;i<50;i++){
    myColor = new Color(_root["myclip" + i]);
    myColor.setRGB(...);
    }

    hope I understood your problem..