User Guide

Color 421
setRGB (Color.setRGB method)
public setRGB(offset:Number) : Void
Deprecated since Flash Player 8. The Color class has been deprecated in favor of the
flash.geom.ColorTransform class.
Specifies an RGB color for a Color object. Calling this method overrides any previous
Color.setTransform() settings.
Availability: ActionScript 1.0; Flash Player 5
Parameters
offset:Number - 0xRRGGBB The hexadecimal or RGB color to be set. RR, GG, and BB each
consist of two hexadecimal digits that specify the offset of each color component. The
0x tells
the ActionScript compiler that the number is a hexadecimal value.
Example
This example sets the RGB color value for the movie clip
my_mc. To see this code work, place
a movie clip on the Stage with the instance name
my_mc. Then place the following code on
Frame 1 in the main Timeline and select Control > Test Movie:
var my_color:Color = new Color(my_mc);
my_color.setRGB(0xFF0000); // my_mc turns red
See also
setTransform (Color.setTransform method), rgb (ColorTransform.rgb property)
setTransform (Color.setTransform method)
public setTransform(transformObject:Object) : Void
Deprecated since Flash Player 8. The Color class has been deprecated in favor of the
flash.geom.ColorTransform class.
Sets color transform information for a Color object. The
colorTransformObject parameter
is a generic object that you create from the
new Object constructor. It has parameters
specifying the percentage and offset values for the red, green, blue, and alpha (transparency)
components of a color, entered in the format 0xRRGGBBAA.
The parameters for a color transform object correspond to the settings in the Advanced Effect
dialog box and are defined as follows:
ra is the percentage for the red component (-100 to 100).
rb is the offset for the red component (-255 to 255).
ga is the percentage for the green component (-100 to 100).