1 Reply Latest reply on Apr 28, 2015 7:31 PM by Ned Murphy

    Changing Color using Identifier in AS2?

    JonnyDL Level 1

      I have a Movie clip of  a simple box, I'm having several of them animate in and out repeatedly. In would be one color, then out then back in with another color.

      Is there a way to use the movie clips identifier to change them all at once?

        • 1. Re: Changing Color using Identifier in AS2?
          Ned Murphy Adobe Community Professional & MVP

          You could use a loop and change them somewhat all at once... the eye would not be able to detect them being done sequentially at loop speed.   You can either name them all similarly with a numeric sequence (box1,box2,box3,etc) and use bracket notation to loop thru them, or you could place the names in an array and loop thru the array.

           

          for(i=1; i<numBoxes; i++){

               this["box"+i]..... change its color however you plan to

          }

           

          OR

           

          var boxes = new Array (box1,box2,box3,etc);

           

          for(i=1; i<boxes.length; i++){

               boxes[i]..... change its color however you plan to

          }

          1 person found this helpful