ColorTransform (flash.geom.ColorTransform)
439
colorTrans.redMultiplier = .5;
trace(colorTrans.redMultiplier); // .5
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number,
scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
redOffset (ColorTransform.redOffset property)
public redOffset : Number
A number from -255 to 255 that is added to the red channel value after it has been multiplied
by the
redMultiplier
value.
Availability:
ActionScript 1.0; Flash Player 8
Example
The following example creates the ColorTransform object
colorTrans
and adjusts its
redOffset
value from 0 to 255.
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.redOffset); // 0
colorTrans.redOffset = 255;
trace(colorTrans.redOffset); // 255
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number,
scope:MovieClip):MovieClip {
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...