Hello everybody...
I have a mc on my stage and it's duplicated several times. I want to give each instance a different color, and instead of having several movieClips, how can I assign them a color with AS?
Thanks for your help.
Halanis
Printable View
Hello everybody...
I have a mc on my stage and it's duplicated several times. I want to give each instance a different color, and instead of having several movieClips, how can I assign them a color with AS?
Thanks for your help.
Halanis
Assuming the movie clip is just a fill color inside it, and not some picture, then give each movie clip a new instance name like myColor1, myColor2, and so on. Then, in an actions layer, you can use this code;
myColor1 = new Color(myColor1);
myColor1.setRGB(0x0000FF);
myColor2 = new Color(myColor2);
myColor2.setRGB(0xFF0000);
how do i make a button change its color?
thanks!
-manny
just change the tint of the mc. Look in the properties panle
A button symbol is one of Flash's automatic built in objects. It has 4 frames. The first is the static frame, what you see when it's not rolled over. Second is the over frame, third the down frame. The fourth frame is just the hit area and never visible in the flash movie.
To make a button symbol change color or anything else when it's rolled over or pressed, just build the static look in frame 1. Convert frame 2 to a Blank Keyframe and build the over look in that, The same for frame 3, blank keyframe, then put what you want in it. The blank keyframes kill anything on a layer timeline that came before it.
In frame 4, especially if you only use text, you need to put a color fill in it, with no outline, to act as a hit area, otherwise when you mouse over the button, only the text is the hit area and it's only chance that rolling over the lines of the text will make it change.
I have quite a few buttons.. making all these frames is not the smartest way to go about it...
I'd like to have a button that just says.. "Change to this color"
sorry for the confusion... I'm trying to make a button change the color of a MC
If all you're trying to do is make a button change the color of an MC...the above code will work.
on(release){
myColor1 = new Color(myColor1);
myColor1.setRGB(0x0000FF);
}
Take a look at this file, it demonstrates what you are looking for.
It was made in MX2004, AS2.
Hope it helps.