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;
}
rgb (ColorTransform.rgb property)
public rgb : Number
The RGB color value for a ColorTransform object.
When you set this property, it changes the three color offset values (
, and
greenOffset
blueOffset
(
,
redMultiplier
greenMultiplier
multiplier and offset values do not change.
Pass a value for this property in the format: 0xRRGGBB. RR, GG, and BB each consist of two
hexadecimal digits that specify the offset of each color component. The 0x tells the
ActionScript compiler that the number is a hexadecimal value.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example creates the ColorTransform object
value to 0xFF0000.
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.rgb); // 0
colorTrans.rgb = 0xFF0000;
trace(colorTrans.rgb); // 16711680
trace("0x" + colorTrans.rgb.toString(16)); // 0xff0000
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 {
scope = (scope == undefined) ? this : scope;
440
ActionScript classes
) accordingly, and it sets the three color multiplier values
, and
blueMultiplier
,
redOffset
) to 0. The alpha transparency
and adjusts its
colorTrans
rgb
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?