Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the color of a movieclip each time it loops?

Status
Not open for further replies.

DGTLguy

Technical User
Jul 23, 2003
125
US
I have a hexagon that follows a motion path. This motion path is a movie clip, and so is the hexagon inside the motion path movieclip. Each time it loops I want it to randomly choose between 4 colors. Any ideas? I was trying to create a function using the Color object, but it didn't seem to work for movieclips inside a movie clip for some reason. Any help would be great. Thanks in advance.

 
You should use actionscript, but I'm guessing you aren't referencing the mc right.

Where did you place the script code, and where is the mc you want to reference?
 
Well I tried placing the code inside the movieclip and also on the stage timeline.
Right now, my code is as such:
color1 = new Color(path1_mc.spiral);
color1.setRGB(0x843B31);

this is placed on the timeline on the stage, and spiral is the movieclip that moves within the path1_mc movieclip which is on the stage. I have a total of 10 path movieclips, each with a spiral inside. The movieclips start playing on a mousemove event, and this color code is also inside that event right now. Any ideas on where to put it? Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top