User Guide

516 Chapter 7: ActionScript for Flash
Example
This example creates a new Color object for a target SWF file, creates a generic object called
myColorTransform with the properties defined above, and uses the setTransform() method to
pass the
colorTransformObject to a Color object.
// Create a color object called my_color for the target my_mc
var my_color:Color = new Color(my_mc);
// Create a color transform object called myColorTransform using
// Set the values for myColorTransform
var myColorTransform:Object = { ra: 50, rb: 244, ga: 40, gb: 112, ba: 12, bb:
90, aa: 40, ab: 70};
// Associate the color transform object with the Color object
// created for my_mc
my_color.setTransform(myColorTransform);