Recipe 10.3. Resetting Color


Problem

You want to reset the color of a display object back to the default.

Solution

Assign a new ColorTransform object with default values to the transform.colorTransform property of the display object.

Discussion

The default values of a flash.geom.ColorTransform object will reset the color of a display object. You can construct a ColorTransform object with default values by calling the constructor with no parameters. The following example resets the color settings for sampleSprite:

sampleSprite.transform.colorTransform = new ColorTransform(  );

See Also

Recipes 10.1 and 10.2




ActionScript 3. 0 Cookbook
ActionScript 3.0 Cookbook: Solutions for Flash Platform and Flex Application Developers
ISBN: 0596526954
EAN: 2147483647
Year: 2007
Pages: 351

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net