flash actionscript 3.0 change color

bellow is a simple example to change the color of a DisplayObject(MovieClip,Button,Sprite) in flash actionscript 3.0.

// creates a red square
var square:Shape = new Shape();
//fill the square with blue color
// drow the square
square.graphics.drawRect(0, 0, 150, 150);
//add the square to stage
// calling the change color function

//changeColor function
function changeColor(o:DisplayObject,color:Number):void {
//create a new ColorTransform
var newColor:ColorTransform=new ColorTransform();
// set the color property
//assign the new ColorTransform to target DisplayObject

PHP developer Cochin |PHP developer Kerala | PHP developer India | Flash developer/programmer Cochin | Flash developer/programmer Kerala | Flash developer/programmer India | web programmer kerala |web programmer Cochin |web programmer India |web developer kerala |Web developer Cochin | Kerala PHP | PHP freelancer| flash actionscript freelancer