03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

This example sets the RGB color value for the movie clip my_mc. To see this code work, place<br />

a movie clip on the Stage with the instance name my_mc. Then place the following code on<br />

Frame 1 in the main Timeline <strong>and</strong> select Control > Test Movie:<br />

var my_color:Color = new Color(my_mc);<br />

my_color.setRGB(0xFF0000); // my_mc turns red<br />

See also<br />

setTransform (Color.setTransform method)<br />

setTransform (Color.setTransform method)<br />

public setTransform(transformObject:Object) : Void<br />

Sets color transform information for a Color object. The colorTransformObject parameter<br />

is a generic object that you create from the new Object constructor. It has parameters<br />

specifying the percentage <strong>and</strong> offset values for the red, green, blue, <strong>and</strong> alpha (transparency)<br />

components of a color, entered in the format 0xRRGGBBAA.<br />

The parameters for a color transform object correspond to the settings in the Advanced Effect<br />

dialog box <strong>and</strong> are defined as follows:<br />

■ ra is the percentage for the red component (-100 to 100).<br />

■ rb is the offset for the red component (-255 to 255).<br />

■ ga is the percentage for the green component (-100 to 100).<br />

■ gb is the offset for the green component (-255 to 255).<br />

■ ba is the percentage for the blue component (-100 to 100).<br />

■ bb is the offset for the blue component (-255 to 255).<br />

■ aa is the percentage for alpha (-100 to 100).<br />

■ ab is the offset for alpha (-255 to 255).<br />

You create a colorTransformObject parameter as follows:<br />

var myColorTransform:Object = new Object();<br />

myColorTransform.ra = 50;<br />

myColorTransform.rb = 244;<br />

myColorTransform.ga = 40;<br />

myColorTransform.gb = 112;<br />

myColorTransform.ba = 12;<br />

myColorTransform.bb = 90;<br />

myColorTransform.aa = 40;<br />

myColorTransform.ab = 70;<br />

You can also use the following syntax to create a colorTransformObject parameter:<br />

Color 301

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!