The ColorTransform ClassThe ColorTransform class is an object containing specific RGB and alpha properties. It is important when using this class to import it first at the beginning of your script, like this: import flash.geom.ColorTransform; To instantiate a new instance of the GradientGlowFilter class, use this code as a template:
Example: This example will create an instance of the ColorTransform class: import flash.geom.ColorTransform; var myTransform:ColorTransform = new flash.geom.ColorTransform (1, .7, .8, 1, 5, 15, 25, 0); Because all but one of the properties of this object match the parameters identically, they will be skipped. PropertiesrgbAvailability: FP:8, AS:1.0 Generic Template: mytransform.rgb Description: This property contains the RGB value of a ColorTransform object. Example: This example will create a ColorTransform object and send the rgb property to the Output panel: import flash.geom.ColorTransform; var myTransform:ColorTransform = new flash.geom.ColorTransform (1, .7, .8, 1, 5, 15, 25, 0); trace(myTransform.rgb); //output: 331545 MethodsconcatAvailability: FP:8, AS:1.0 Generic Template: myTRansform.concat(colorTransform); Parameters:
Description: This method will add a second color transformation to a movie clip. Example: This example will import the necessary class file. Then we create the first instance of the ColorTransform object we need and trace its redOffset property. Next, the second ColorTransform object is created and concatenated to the first. Finally, the redOffset property of the first object is traced again to reveal it has changed: import flash.geom.ColorTransform; //first ColorTransform object var myTrans:ColorTransform = new ColorTransform(1, 1, 1, 1, 200, 0, 0, 0); trace(myTrans.redOffset); //second ColorTransform object var myTrans2:ColorTransform = new ColorTransform(1, 1, 1, .5, 55, 0, 0, 0); //concat the color transforms myTrans.concat(myTrans2); trace(myTrans.redOffset); //output: 200 // 255 toStringAvailability: FP:8, AS:1.0 Generic Template: mytransform.toString(); Returns: String This method will return a formatted string containing all the ColorTransform properties. Description: This method will return a formatted string with each individual property labeled and defined. Example: This example will create a ColorTransform object and trace all of its properties using the toString method:
|