View comments | RSS feed

ColorTransform constructor

public ColorTransform([redMultiplier:Number], [greenMultiplier:Number], [blueMultiplier:Number], [alphaMultiplier:Number], [redOffset:Number], [greenOffset:Number], [blueOffset:Number], [alphaOffset:Number])

Creates a ColorTransform object for a display object with the specified color channel values and alpha values.

Availability: ActionScript 1.0; Flash Player 8

Parameters

redMultiplier:Number [optional] - The value for the red multiplier, in the range from 0 to 1. The default value is 1.

greenMultiplier:Number [optional] - The value for the green multiplier, in the range from 0 to 1. The default value is 1.

blueMultiplier:Number [optional] - The value for the blue multiplier, in the range from 0 to 1. The default value is 1.

alphaMultiplier:Number [optional] - The value for the alpha transparency multiplier, in the range from 0 to 1. The default value is 1.

redOffset:Number [optional] - The offset for the red color channel value (-255 to 255). The default value is 0.

greenOffset:Number [optional] - The offset for the green color channel value (-255 to 255). The default value is 0.

blueOffset:Number [optional] - The offset for the blue color channel value (-255 to 255). The default value is 0.

alphaOffset:Number [optional] - The offset for alpha transparency channel value (-255 to 255). The default value is 0.

Example

The following example creates a ColorTransform object called greenTransform:

var greenTransform:flash.geom.ColorTransform = new flash.geom.ColorTransform(0.5, 1.0, 0.5, 0.5, 10, 10, 10, 0);

The following example creates the ColorTransfrom object colorTrans_1 with the default constructor values. The fact that colorTrans_1 and colorTrans_2 trace the same values is evidence that the default constructor values are used.

import flash.geom.ColorTransform;

var colorTrans_1:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
trace(colorTrans_1); 
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)

var colorTrans_2:ColorTransform = new ColorTransform();
trace(colorTrans_2); 
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)

Version 8

Comments


LAlekse said on Sep 20, 2005 at 7:44 AM :
It seems that the "multiplier" properties can be between -1 and 1... like in the Flash IDE! ;o)
_depth_ said on Aug 22, 2006 at 4:44 PM :
the params for the ColorTransform constructor are not actually optional,
despite being marked as such in Help. if any params are omitted, the
values are not actually set. you must pass all 8 params for any one of them
to actually change the value of a ColorTransform property.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002088.html