Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

senocular.com ActionScript Library

setRGBA.as

Name: setRGBA() - set RGB with alpha
Author: senocular: www.senocular.com
Date: 1899-12-31T00:50:12.900
Documentation:
Color SETRGBA: sets rgb (hex) and alpha (-100 to 100)
similar to that of setRGB only with an alpha argument.

Arguments:
- hex: basic RGB hex color as added in setRGB
- a: alpha.  transparency value -100 to 100 where 0 is transparent and 100 is opaque.

Returns:
nothing

Example:
var col = new Color(my_mc);
col.setRGBA(0xFF0000, 50); // red with 50% transparency

1
2
3
4
Color.prototype.setRGBA = function(hex, a){
	this.setRGB(hex);
	this.setTransform({aa:a})
}