Example
This example creates a new Color object for a target SWF file, creates a generic object called
with the properties defined above, and uses the
method to
myColorTransform
setTransform()
pass the
to a Color object. To use this code in a Flash (FLA) document,
colorTransformObject
place it on Frame 1 on the main Timeline and place a movie clip on the Stage with the instance
name
, as in the following code:
my_mc
// 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);
212
Chapter 2: ActionScript Language Reference
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?