Dynamically changing colors
Here is an example of the use for this. Just a simple effect achieved by using the Color class. I won't explain the code, unless you ask for it of course.
First, draw a circle or something that you want to change colors on. Remember that the code we will write will change the color of the whole Movie Clip, so if you are going to do shades and lines like in the example, do it separately later on.
Turn what you drew into a Movie Clip (F8 > Movie Clip > OK). Go to the Properties panel (Ctrl+F3), and in the box where it says "<Instance Name>", enter "myShape" (without the quotes).
Now, we will make a new color object. Add this to the frame's actionscript:
var myColor:Color = new Color(_root.myShape);
Then, draw a button. Make it a button (F8 > Button > OK), and add this to it's actionscript:
on (release) {
balloon_color.setRGB(0xFF0000);
}
Now, if you test the movie and click the button, the shape you drew should turn red (if, of course, it wasn't red already).
Related AS threads:
AS: Variables
AS: OOP (Object Oriented Programming) by Inglor
AS: Photo Negative by Glaiel_Gamer
