Does anyone know how to control the brightness of a movieclip through action script. I can’t seem to find the syntax for that property (if there is such a thing).
Thanks,
Brock
Does anyone know how to control the brightness of a movieclip through action script. I can’t seem to find the syntax for that property (if there is such a thing).
Thanks,
Brock
Theres no brightness property - all collor handling is managed through something called a color object. What this is, is a seperate object, kind of like the movieclip object, but is used only for handling the color of the movieclip specified. It however, uses its own builtin methods (or functions) to change the color, not properties specifically. The common functions for that are setRGB and setTransform.
Example:
// make a new color object to manipulate the colors
// of the movieclip called "myMovieClip"
myColorObject = new Color(myMovieClip);
// now set the color of myMovieClip to red
myColorObject.setRGB(0xff0000);
using the hexidecimal color of red, 0xff0000, in the setRGB function in this case, changes the color of myMovieClip from whatever it was to now, red.
using setTransform is a little more difficult - its usage is outlined in the Flash help dictionary. It is what you would use to control brightness.
However, doing that can be confusing in its own right. So people have written functions that will make it easier for you to change your color object for more specific changes like brightness etc. You can find many of these functions here:
http://proto.layer51.com/l.aspx?p=10
These functions are used just like setRGB was used in the previous example. All you have to do is copy the code in the example you want to use and place that in the first frame of your movie defining it for Flash (so it knows how to use the code when you try to).
:: Copyright KIRUPA 2024 //--