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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methods inherited from class Object<br />

addProperty (Object.addProperty method), hasOwnProperty<br />

(Object.hasOwnProperty method), isPropertyEnumerable<br />

(Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf<br />

method), registerClass (Object.registerClass method), toString<br />

(Object.toString method), unwatch (Object.unwatch method), valueOf<br />

(Object.valueOf method), watch (Object.watch method)<br />

Color constructor<br />

public Color(target:Object)<br />

Creates a Color object for the movie clip specified by the target_mc parameter. You can then<br />

use the methods of that Color object to change the color of the entire target movie clip.<br />

Parameters<br />

target:Object - The instance name of a movie clip.<br />

Example<br />

The following example creates a Color object called my_color for the movie clip my_mc <strong>and</strong><br />

sets its RGB value to orange:<br />

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

my_color.setRGB(0xff9933);<br />

getRGB (Color.getRGB method)<br />

public getRGB() : Number<br />

Returns the R+G+B combination currently in use by the color object.<br />

Returns<br />

Number - A number that represents the RGB numeric value for the color specified.<br />

Example<br />

The following code retrieves the RGB value for the Color object my_color, converts the value<br />

to a hexadecimal string, <strong>and</strong> assigns it to the myValue variable. To see this code work, add a<br />

movie clip instance to the Stage, <strong>and</strong> give it the instance name my_mc:<br />

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

// set the color<br />

my_color.setRGB(0xff9933);<br />

var myValue:String = my_color.getRGB().toString(16);<br />

// trace the color value<br />

Color 299

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

Saved successfully!

Ooh no, something went wrong!