Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try using the color transform object.</p> <pre><code>var redAmount:Number = 0; var greenAmount:Number = 0; var blueAmount:Number = 1; var alphaAmount:Number = 1; var redOffset:Number = 0; var greenOffset:Number = 0; var blueOffset:Number = 0; var alphaOffset:Number = 0; yourDisplayObject.transform.colorTransform = new ColorTransform(redAmount, greenAmount, blueAmount, alphaAmount, redOffset, greeenOffset, blueOffset, alphaOffset); </code></pre> <p>The first four variables are multipliers - they will take the existing color value and adjust it as if multiplying by that number. So to reduce a color by 1/2 use 0.5. To make black set all to 0. To change nothing make all 1's.</p> <p>The second four variables will increase or decrease the color amount of all pixels by that amount. So to make a color hit a specific hex value, say 0xFFCC33, you would do this:</p> <pre><code>yourDisplayObject.transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0xFF, 0xCC, 0x33, 0x00); </code></pre> <p>Here is a link to the adobe documentation if you need more help: <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/ColorTransform.html" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/ColorTransform.html</a></p> <p>If you decide you want to change the color gradually instead of instantly take a look at TweenMax from greensock. The greensock tween classes are a widely used workhorse of actionscript programming. </p> <p>To tint a display object with TweenMax the code would be:</p> <pre><code>TweenMax.to(yourDisplayObject, 1, {tint:0x0000FF}); </code></pre> <p>This class applies a color transform to the object using that code, but it changes the values gradually over time</p> <p>Here is a link to where you can get TweenMax. <a href="http://www.greensock.com/tweenmax/" rel="nofollow">http://www.greensock.com/tweenmax/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload