IMPORTANT NOTE [10/07/07]: Tweeners SpecialPropertiesDefault.as has been deprecated since Tweener version 1.27.62. All listed color properties (_brightness, _contrast, _saturation) are now included in Tweener version 1.30.66 and higher. For more information check Tweeners changelog on Google Code. Kudos to Zeh Fernando for the latest releases.

There are a lot of AS3 Animation packages out there, all with pros and cons. One of my favorite tools is Tweener AS3, but at its current version (v.1.0.1) it supports only few color properties such as _color, _color_ra, _color_rb and so on. However, you have the option to create your own special properties using Tweener.registerSpecialProperty. So I decided to write an extension for missing color properties _brightness, _contrast and _saturation based on the awesome ColorMatrix by Mario Klingemann. Check it out!

Example

Get Adobe Flash player

 

Instruction

  1. Download the latest AS3 version of Tweener on Google Code.
  2. Copy the following ColorMatrix.as to {yourTweenerFolder}/caurina/transitions.

    ColorMatrix.as ( Download code )

    1. /**
    2. * ColorMatrix class, which provides special color properties
    3. * called "_contrast", "_brightness", "_saturation"
    4. * using Tweener AS3 (http://code.google.com/p/tweener/).
    5. *
    6. * Based on Mario Klingemanns awesome AS2 ColorMatrix v1.2
    7. * (http://www.quasimondo.com/archives/000565.php)
    8. *
    9. * @author  Jens Krause [www.websector.de]
    10. * @date    08/28/07
    11. * @see  http://www.websector.de/blog/2007/08/28/tweener-as3-extension-for-color-properties-_brightness-_contrast-and-_saturation/
    12. *
    13. */
    14.  
    15. package caurina.transitions
    16. {
    17.     import flash.filters.ColorMatrixFilter;
    18.    
    19.     public class ColorMatrix
    20.     {   
    21.         //
    22.         // Luminance conversion constants   
    23.         private static const R_LUM:Number = 0.212671;
    24.         private static const G_LUM:Number = 0.715160;
    25.         private static const B_LUM: Number = 0.072169;
    26.         //   
    27.         // min / max values for special tween properties called "_contrast"  
    28.         private static const MIN_CONTRAST: Number = -200;
    29.         private static const MAX_CONTRAST: Number = 500;
    30.         private static const STANDARD_CONTRAST: Number = 0;
    31.         //   
    32.         // min / max values for special tween properties called "_brightness"      
    33.         private static const MIN_BRIGHTNESS: Number = -100;
    34.         private static const MAX_BRIGHTNESS: Number = 100;
    35.         private static const STANDARD_BRIGHTNESS: Number = 0;
    36.         //   
    37.         // min / max values for special tween properties called "_saturation"      
    38.         private static const MIN_SATURATION: Number = -300;
    39.         private static const MAX_SATURATION: Number = 300;           
    40.         private static const STANDARD_SATURATION: Number = 100;
    41.         //
    42.         // standard matrix   
    43.         private static const IDENTITY:Array = [ 1,0,0,0,0,
    44.                                                 0,1,0,0,0,
    45.                                                 0,0,1,0,0,
    46.                                                 0,0,0,1,0 ];
    47.         //
    48.         // matrix   
    49.         public var matrix:Array;       
    50.  
    51.         /**
    52.          * Constructor of ColorMatrix
    53.          *
    54.          * @param      mat            Object  A ColorMatrix instance or an array   
    55.          *     
    56.          */  
    57.         function ColorMatrix (mat:Object = null)
    58.         {
    59.             if (mat is ColorMatrix)
    60.             {
    61.                 matrix = mat.matrix.concat();
    62.             }
    63.             else if (mat is Array)
    64.             {
    65.                 matrix = mat.concat();
    66.             }
    67.             else
    68.             {
    69.                 reset();
    70.             }         
    71.         }
    72.        
    73.         /**
    74.          * Resets the matrix to its IDENTITY
    75.          *     
    76.          */   
    77.         public function reset():void
    78.         {
    79.             matrix = IDENTITY.concat();
    80.         }
    81.        
    82.         /**
    83.          * Clones the instance of ColorMatrix
    84.          *     
    85.          */   
    86.         public function clone():ColorMatrix
    87.         {
    88.             return new ColorMatrix( matrix );
    89.         }
    90.  
    91.         ///////////////////////////////////////////////////////////
    92.         // brightness
    93.         ///////////////////////////////////////////////////////////
    94.        
    95.         /**
    96.          * Calculate an average of particular indexes of its matrix
    97.          *
    98.          * @return    Number    Value of a brightness value for using Tweener
    99.          *
    100.          */  
    101.         public function getBrightness (): Number
    102.         {
    103.             // average of "brightness"-indexes within matrix
    104.             var value: Number = (matrix[4] + matrix[9] + matrix[14]) / 3;
    105.             // convert back to a "valid" tween property between min and max values
    106.             if (value != 0) value = value * 100 / 255;
    107.             return Math.round(value);
    108.         }
    109.        
    110.         /**
    111.          * Changes matrix to alter brightness
    112.          *
    113.          * @param      Number Value of Tweeners brightness property
    114.          *
    115.          */   
    116.         public function setBrightness (value: Number):void
    117.         {
    118.             var brightness: Number = checkValue(MIN_BRIGHTNESS, MAX_BRIGHTNESS, value);
    119.             // converts tween property to a valid value for the matrix
    120.             brightness = 255 * brightness / 100;
    121.            
    122.             var mat:Array[  1,0,0,0, brightness,
    123.                                0,1,0,0, brightness,
    124.                                0,0,1,0, brightness,
    125.                                 0,0,0,1, 0  ];
    126.        
    127.             concat(mat);           
    128.         }
    129.  
    130.         ///////////////////////////////////////////////////////////
    131.         // contrast
    132.         ///////////////////////////////////////////////////////////
    133.         /**
    134.          * Calculate an average of particular indexes of its matrix
    135.          *
    136.          * @return    Number        Value of a contrast value for using Tweener
    137.          *
    138.          */   
    139.         public function getContrast (): Number
    140.         {
    141.             // average of "contrast"-indexes within matrix
    142.             var value: Number = (matrix[0] + matrix[6] + matrix[12]) / 3;
    143.             // converts back to a "valid" tween property between min and max values
    144.             value = (value – 1) * 100;
    145.             return value;
    146.         }
    147.        
    148.         /**
    149.          * Changes matrix to alter contrast
    150.          *
    151.          * @param      Number  Value of Tweeners brightness property
    152.          *
    153.          */ 
    154.         public function setContrast (value: Number):void
    155.         {
    156.             var contrast: Number = checkValue(MIN_CONTRAST, MAX_CONTRAST, value);
    157.             // convert tween property to a valid value for the matrix
    158.             contrast /= 100;
    159.           var scale: Number = contrast + 1;
    160.             var offset : Number = 128 * (1 – scale);
    161.               
    162.             var mat: Array = [  scale,    0,         0,   0,   offset,
    163.                                 0,   scale,   0,       0,     offset,
    164.                                 0,   0,     scale,    0,     offset,
    165.                                 0,   0,     0,       1,     0      ];
    166.                                            
    167.             concat(mat);
    168.         }
    169.  
    170.         ///////////////////////////////////////////////////////////
    171.         // saturation
    172.         ///////////////////////////////////////////////////////////
    173.         /**
    174.          * Calculate an average of particular indexes of its matrix
    175.          *
    176.          * @return    Number        Value of a saturation value for using Tweener
    177.          *
    178.          */  
    179.         public function getSaturation (): Number
    180.         {      
    181.             //
    182.             // uses 3 "saturation"-indexes within matrix – once per color channel – ignore the others…
    183.             var s1: Number = 1 – matrix[1] / G_LUM;
    184.             var s2: Number = 1 – matrix[2] / B_LUM;
    185.             var s5: Number = 1 – matrix[5] / R_LUM;
    186.             // average of these "saturation"-indexes
    187.             var value: Number;
    188.             value = Math.round((s1 + s2 + s5) / 3);
    189.             value *= 100;      
    190.            
    191.             return value;
    192.         }      
    193.  
    194.         /**
    195.          * Changes matrix to alter contrast
    196.          *
    197.          * @param      Number  Value of Tweeners saturation property
    198.          *
    199.          */ 
    200.         public function setSaturation (value: Number): void
    201.         {
    202.             var saturation: Number = checkValue(MIN_SATURATION, MAX_SATURATION, value);   
    203.            
    204.             saturation /=  100;
    205.            
    206.             var isValue: Number = 1-saturation;
    207.            
    208.             var irlum: Number = isValue * R_LUM;
    209.             var iglum: Number = isValue * G_LUM;
    210.             var iblum: Number = isValue * B_LUM;
    211.            
    212.             var mat:Array[    irlum + saturation,   iglum,                 iblum,     0, 0,
    213.                                 irlum,             iglum + saturation, iblum,                 0, 0,
    214.                                     irlum,     iglum,         iblum + saturation, 0, 0,
    215.                                     0,      0,           0,                1, 0 ];
    216.                    
    217.             concat(mat);
    218.         }
    219.  
    220.  
    221.         /**
    222.          * Concatenates the elements of a matrix specified in the parameter with the elements in an array and creates a new matrix
    223.          *
    224.          * @param      Array    Altered Matrix
    225.          *
    226.          */   
    227.         public function concat(mat:Array):void
    228.         {      
    229.             var temp:Array = new Array ();
    230.             var i:Number = 0;
    231.            
    232.             for (var y:Number = 0; y < 4; y++ )
    233.             {
    234.                
    235.                 for (var x:Number = 0; x < 5; x++ )
    236.                 {
    237.                     temp[i + x] =   mat[i] * matrix[x] +
    238.                                     mat[i+1] * matrix[x + 5] +
    239.                                     mat[i+2] * matrix[x + 10] +
    240.                                     mat[i+3] * matrix[x + 15] +
    241.                                     (x == 4 ? mat[i+4] : 0);
    242.                 }
    243.                 i+=5;
    244.             }
    245.            
    246.             matrix = temp;     
    247.         }
    248.  
    249.         /**
    250.          * Instanciates a ColorMatrixFilter using ColorMatrix matrix
    251.          *
    252.          * @return    ColorMatrixFilter  ColorMatrixFilter using the matrix of a ColorMatrix instance
    253.          *
    254.          */   
    255.         public function get filter():ColorMatrixFilter
    256.         {
    257.             return new ColorMatrixFilter(matrix);
    258.         }
    259.        
    260.         /**
    261.          * Helper method to check a value for min. and max. values within a specified range
    262.          *
    263.          * @param      Number  min. value of its range
    264.        * @param    Number        max. value of its range
    265.        * @param    Number        checked value
    266.          */   
    267.         private function checkValue(minValue: Number, maxValue: Number, value: Number):Number
    268.         {
    269.             return Math.min(maxValue, Math.max(minValue, value));
    270.         }      
    271.     }
    272. }
  3. Open SpecialPropertiesDefault.as located in {yourTweenerFolder}/caurina/transitions. Copy and paste the following lines to the method called init().

    snippet1.txt ( Download code )

    1. // color brightness
    2. Tweener.registerSpecialProperty("_brightness", __brightness_get, __brightness_set);
    3. // color contrast
    4. Tweener.registerSpecialProperty("_contrast", __contrast_get, __contrast_set);
    5. // color saturation
    6. Tweener.registerSpecialProperty("_saturation", __saturation_get, __saturation_set);
    7.  
  4. Add the following methods to SpecialPropertiesDefault.as after the method init()mentioned above. Don’t forget to import flash.display.DisplayObject and flash.filters.ColorMatrixFilter as well.

  5. snippet2.txt ( Download code )

    1. // ———————————————————————————————————————————-
    2. // _brightness_*
    3.  
    4. /**
    5. * Gets brightness using ColorMatrix
    6. *
    7. * @param      p_obj        DisplayObject A Display Object instance
    8. * @return              Number            Value of the brightness property
    9. */  
    10. public static function __brightness_get (p_obj: DisplayObject):Number
    11. {
    12.     return getColorMatrix(p_obj).getBrightness();
    13. };
    14.  
    15. /**
    16. * Changes brightness of a DisplayObject using ColorMatrix
    17. *
    18. * @param      p_obj        DisplayObject A Display Object instance
    19. * @param      p_value                Number      Value of the brightness property (min: -100 / max: 100 / standard: 0)
    20. */ 
    21. public static function __brightness_set (p_obj:DisplayObject, p_value:Number):void
    22. {
    23.     var colorMatrix: ColorMatrix = new ColorMatrix();
    24.     colorMatrix.setBrightness(p_value);
    25.     setColorMatrix(p_obj, colorMatrix);
    26. };
    27.  
    28. // ———————————————————————————————————————————-
    29. // _contrast_*
    30. /**
    31. * Gets contrast using ColorMatrix
    32. *
    33. * @param      p_obj        DisplayObject A Display Object instance
    34. * @return              Number            Value of the contrast property
    35. */   
    36. public static function __contrast_get (p_obj: DisplayObject):Number
    37. {
    38.     return getColorMatrix(p_obj).getContrast();
    39. };
    40.  
    41. /**
    42. * Changes contrast of a DisplayObject using ColorMatrix
    43. *
    44. * @param      p_obj        DisplayObject A Display Object instance
    45. * @param      p_value                Number      Value of the contrast property (min: -200 / max: 500 / standard: 0)
    46. */ 
    47. public static function __contrast_set (p_obj:DisplayObject, p_value:Number):void
    48. {
    49.     var colorMatrix: ColorMatrix = new ColorMatrix();
    50.     colorMatrix.setContrast(p_value);
    51.     setColorMatrix(p_obj, colorMatrix);
    52. };
    53.  
    54. // ———————————————————————————————————————————-
    55. // _saturation_*
    56. /**
    57. * Gets saturation using ColorMatrix
    58. *
    59. * @param      p_obj        DisplayObject A Display Object instance
    60. * @return              Number            Value of the saturation property
    61. */   
    62. public static function __saturation_get (p_obj: DisplayObject):Number
    63. {
    64.     return getColorMatrix(p_obj).getSaturation();
    65. };
    66.  
    67. /**
    68. * Changes saturation of a DisplayObject using ColorMatrix
    69. *
    70. * @param      p_obj        DisplayObject A Display Object instance
    71. * @param      p_value                Number      Value of the saturation property (min: -300 / max: 300 / standard: 100)
    72. */ 
    73. public static function __saturation_set (p_obj:DisplayObject, p_value:Number):void
    74. {
    75.     var colorMatrix: ColorMatrix = new ColorMatrix();
    76.     colorMatrix.setSaturation(p_value);
    77.     setColorMatrix(p_obj, colorMatrix);
    78. };
    79.  
    80.  
    81. // ———————————————————————————————————————————-
    82. // COLORMATRIX helper functions —————————————————————————————————–
    83.  
    84. /**
    85. * Helper method for getting the ColorMatrix of a DisplayObject
    86. *
    87. * @param      p_obj        DisplayObject A Display Object instance
    88. * @return              ColorMatrix      ColorMatrix of the Display Object
    89. */    
    90. private static function getColorMatrix(p_obj: DisplayObject): ColorMatrix
    91. {
    92.     var filters: Array = p_obj.filters;
    93.     var colorMatrix: ColorMatrix = new ColorMatrix();
    94.  
    95.     var i:int = filters.length;
    96.    
    97.     while(–i > -1)
    98.     {
    99.         if(filters[i] is ColorMatrixFilter)
    100.         {
    101.             colorMatrix.matrix = filters[i].matrix.concat();
    102.             break;
    103.         }            
    104.     }         
    105.     return colorMatrix;
    106. }
    107.  
    108. /**
    109. * Helper method for setting the ColorMatrix of a DisplayObject
    110. *
    111. * @param      p_obj        DisplayObject A Display Object instance
    112. * @param      p_value                ColorMatrix  A ColorMatrix instance
    113. */ 
    114. private static function setColorMatrix(p_obj: DisplayObject, value: ColorMatrix): void
    115. {
    116.     var filters: Array = p_obj.filters;
    117.     var tFilters: Array = new Array();
    118.     var colorMatrix: ColorMatrix = value;
    119.  
    120.     var i:int = filters.length;
    121.    
    122.     while(–i > -1)
    123.     {
    124.         if(!(filters[i] is ColorMatrixFilter))
    125.         {
    126.             tFilters.push(filters[i]);
    127.         }            
    128.     }
    129.    
    130.     tFilters.push(colorMatrix.filter);
    131.     p_obj.filters = tFilters;
    132.  
    133. }
  6. That’s all ;-) . And here are some examples using the special color properties:

    snippet3.txt ( Download code )

    1. //
    2. // brightness example   
    3. Tweener.addTween(myDisplayObject, { _brightness: 100,
    4.                             time: 2,
    5.                                     transition: Quintic.easeOut
    6.                                 });
    7.                                
    8. //
    9. // contrast example
    10. Tweener.addTween(myDisplayObject, { _contrast: -100,
    11.                                     time: 2,
    12.                                     delay: 2,
    13.                                     transition: Quintic.easeOut
    14.                                 })
    15.                                
    16. //
    17. // saturation example
    18. Tweener.addTween(myDisplayObject, { _saturation: 0,
    19.                                     time: 2,
    20.                                     delay: 4,
    21.                                     transition: Quintic.easeOut
    22.                                 })
    23.                                                        

Download full source

TweenerColorMatrixExample.zip
(Downloads: 2287)

Have fun ;-)

36 Responses to “Tweener AS3 extension for color properties “_brightness”, “_contrast” and “_saturation””

  1. Mario Klingemann Says:

    Hey, great job! If you could just get rid of that one “l” too many in my name ;-) -

  2. [draw.logic] Says:

    Excellent. I have also done this but only for brightness. You should contact Zeh Fernando or have this commited into the google code library so it is official.

  3. Tweener AS3 extension for color properties “_brightness”, “_contrast” and “_saturation” « [ draw.logic ] Says:

    [...] Comments WS-Blog Tweener AS… on Updated: List of Best Animatio…mondo on Image Manipulation Using &#821…felisan on Image [...]

  4. [draw.logic] Says:

    One small typo….

    When you say on snippet 2: “Add the following methods to ColorMatrix.as after the method init()mentioned above. Don’t forget to import flash.display.DisplayObject as well.”

    You mean in the SpecialPropertiesDefault.as class just so it doesn’t confuse people for a bit.

    Good work on the contrast and saturation additions.

  5. Jens Franke Says:

    Yeah! Thanks!

  6. Jacob Says:

    Step4 … Don’t forget to import flash.display.DisplayObject as well. AND flash.filters.ColorMatrixFilter;

  7. Erweiterung für Tweener at flash und so… Says:

    [...] Jens Krause gibt es eine kleine Erweiterung für den Tweener, so dass man auch brightness, _contrast und [...]

  8. Nate Chatellier Says:

    Thanks for the contribution Jens!

  9. Moon Says:

    Hi !!

    Very great Job and usefull !!!

    Be careful, some errors in your post…

    1) Add the following methods to SpecialPropertiesDefault.as (snippet2.txt) not ColorMatrix.as

    2) “…Don’t forget to import flash.display.DisplayObject as well…” and flash.filters.ColorMatrixFilter too !!!

    Thx

    Bye_

  10. KinRou Blog » a new package tweener Says:

    [...] colour – brightness, contrast, saturation http://www.websector.de/blog/2007/08/28/tweener-as3-extension-for-color-properties- _brightness-_con… [...]

  11. Rob Says:

    I had to import flash.filters.ColorMatrixFilter in the SpecialPropertiesDefault.as class, but after that it worked great.

    Thanks!

  12. laurent Says:

    demo looks very cool, but I can’t get it to work…
    isn’t there an error on point 4 :
    “Add the following methods to ColorMatrix.as after the method init() mentioned above..”
    no method init() in ColorMatrix…

    thanks !

  13. Quentin Cole Says:

    I’ve converted your code to work with AS2, but it doesn’t seem to be working correctly. I’ve tried tweening the brightness values of a movieclip, without luck. For instance, if I tween the brightness to 100, and then back to 0, it will tween to 100, but will not reset back to 0. Any ideas what might be missing?

  14. LEE Says:

    Very cool class! Thank you!

  15. labs.zeh.com.br » Blog Archive » Misc Tweener links and cool examples to look at Says:

    [...] Krause has an extension to use contrast, saturation and other color properties in Tweener. It’s based on Mario [...]

  16. Alan Says:

    Could you release this extension for AS2 Tweener version? Nice job man…

  17. sectore Says:

    @all: Sorry for my late reply, but I’ve forgotten that I have to login to approve all comments after moving my blog ;-) Anyway, thanks for your great feedback and all helpful tips :-)

    @[draw.logic], @Jacob, @Moon, Rob: Thanks for your hints about my typos. I’ve modified them.

    @[draw.logic]: I’ve contacted Zeh Fernando, he has already known this extension ;-)

    @laurent: Sorry, I meant the the init() method within SpecialPropertiesDefault.as

    @Quentin:
    Sorry, I haven’t any idea…

    @Alan: Sorry, I’ve not intended to release an AS2 version of this extension.

  18. Tom Says:

    Great stuff this.

    Is there a way i can tween saturation and brightness at the same time?

  19. sectore Says:

    @Tom: That’s not a simple task, but I think in the next version of Tweener it will be included. Zeh Fernando has something posted about it: http://labs.zeh.com.br/blog/?p=121

  20. Using Tweener class in Flex Says:

    [...] a little sample on how to use the tweener class (with some add-ons I found on WS-Blog). I recommend the Tweener to everybody who wants to add some more flavour to flex use the tweener [...]

  21. LIFE.Flex » Класс Tweener в Flex Says:

    [...] пример использования класса Tweener (с некторыми дополнениями), очень полезная штука, как [...]

  22. Fabio Says:

    @Tom: the problem is that this class needs to be reistantiated each time we want apply a new value to a property that was previously modified.
    I suppose that this problem can be solved saving a matrix array for each property and in the method concat concats all matrixes in only one (each time a property is modified).
    what do you think?

  23. Kim Says:

    Hey, I’m trying to use your extension with the latest version of tweener, and I can’t seem to make it work. I did everything exactly as described above, and i get some errors. It seems to fail in the two while loops:
    while(–i > -1) in line

    I tried to change this to: while((i*-1) > -1)
    then it got in to an infinite loop and my flash crashed.

    I would really appreciate any help i can get.

  24. sectore Says:

    @Kim: Check out the “IMPORTANT NOTE” described at the beginning of my post using the latest version of Tweener ;-)

    -sectore

  25. JP Says:

    Thanks so much!

    You just gave me hours of sleeping time!

    Great coding!

  26. andreb Says:

    Hi all, i hope someone is still alive and can help me :P

    I’ve sucessfully installed and used this extension but i want to do something that im not understanding how…how can i start with a mc that ha 100% brightness and then bring it down to 0% ?? The contrary way is easy but this…it must be easy too but i’m learning and cant figure it out! :(

    Thanks

  27. sectore Says:

    @andreb: Please check the note at to top of this post and use the latest version of Tweener instead ;-) . It has already implemented all the color properties mentioned above.

    -sectore

  28. tasovi Says:

    Hi, I get this error when using your extension:
    ReferenceError: Error #1069:
    _brightness is not found at flash.display.Sprite

    whats wrong?

  29. Mrtn Says:

    Fernando’s Tweener version for as3 is only at 1.26, not at 1.30 like you say… Also “_saturation” does not work in the latest version, man..

  30. sectore Says:

    Mrtn,

    don’t use the *.zip file located on Tweeners project at Google Code. Check out the latest version mentioned above using the source available at its Repository:
    http://code.google.com/p/tweener/source/checkout

    -Jens

  31. Zeh Fernando » Blog Archive » Misc Tweener links and cool examples to look at Says:

    [...] Krause has an extension to use contrast, saturation and other color properties in Tweener. It’s based on Mario [...]

  32. Erik Says:

    Hi!

    Nice job! I get two errors though in the “snippet2.txt” on lines 97 and 122. The “while(–i > -1)” gives me an error in FlashCS3.

    So I had to change that to “while(i > -1)”, and then it worked fine?

    Any ideas why this happened?

  33. Erik Says:

    Hi again!

    I just noticed that when I copied the code from above, somehow the “-” sign changed into a longer version of the “-” sign??? Don’t ask me how this happened? So I had to change the “-” sign in the as file into a normal “-” sign, to get it to work… strange computers, sometimes I think they are “alive”…

    Cheers ;-)

  34. rich Says:

    hi, I downloaded the latest version of tweener but I absolutely have no luck getting this extension to work. Can anyone kind enough to have a a working version (using the above FLA/source) send me a zip file? Perhaps Im not doing it right, but spending almost an hour on trying different things I just couldnt get this to work. My email is flashbam@yahoo.com, thanks.

  35. Baguz Says:

    @rich

    You can use the latest version. Before you can use special properties, you must initialize it first.. This is what i did when i using brightness tween.

    //if you want to use brightness, then you need ColorShortcuts..
    import caurina.transitions.properties.ColorShortcuts;

    //initialize once..
    ColorShortcuts.init();

    //play around..
    Tweener.addTween(aaa, { _brightness:1, time:1} );

    Cheers :D

  36. Quick tip:Contrast & Brightness In ActionScript 3 at Jozef Chú?ka's blog Says:

    [...] caurina.transitions.ColorMatrix class created by Jens Krause [...]

Leave a Reply

Follow sectore on Twitter