Or try this …
Flash uses RGB colour space to describe colours. This example dynamically transform a colour object to black and white.
Any coloured object in Flash has four attributes red, blue, green and alpha (transparency). Red Green and Blue may have values from -255 to 255 and Alpha ranges from 0 to 100 (0=fully transparent and 100=fully opaque)
Flash allows you to manipulate these properties either manually when authoring an fla or dynamically (by ActionScript) at runtime in the swf.
To manipulate colour offsets manually:
Define the object that you want to colour as a Movie Clip (select the object, click F8, choose Movie Clip and give an instance name). Then select the Effects palatte and choose Advanced from the drop down menu.
Drag the slider bars and look at how the colour of the image changes. If you set the values so that R=0%, G=0%, B=0% and Alpha=40% you will see that you have a pretty good approximation of black and white.
To manipulate the offsets dynamically:
First of all you have to define a colour object - i.e. you have to specify an instance of a movie clip whose colour you want to change. Here we’re using the instance mcInstance:
chameleon= new Color (mcInstance)
Next we need to specify a colour transformation we wish to perform - a colour transformation object. To achive the black and white look our colour transformation (named colourChange) object is:
colourChange = { ra: ‘0’, rb: ‘0’, ga: ‘0’, gb: ‘0’, ba: ‘0’, bb: ‘0’, aa: ‘40’, ab: ‘0’}
Then we invoke the colour transformation method:
chameleon.setTransform(colourChange);
and we have dynamically changed the colour.