AS2 Luminosity Gray Scale Utility
This is a purely code based implementation of the ubiquitous gray scale/luminosity filter. While most common implementations of this effect tend to be timeline based and therefore lacking in flexibility this little gem of code-driven ingenuity is
free from such constraints and open to wider application. Better yet, this utility was built with ease of use in mind.
Near effortless two-step setup process involves simply copying the script to a folder and referencing the script via an #include statement on the main timeline. Once that's done every movieclip will support the fabulous _grayScale property. Property? You ask. That is precisely the beauty of this utility. After the initial setup, the effect is accessible via the _grayScale property on ANY movieclip instance. Allow me to reiterate... A-N-Y movieClip instance. Hence forth you merely set the property to a value between 0 and 100 inclusive. Set the property to 100 and viola! You've got a full grayscale version of your movieclip. Furthermore you can easily tween the property to fade from color to grayscale and back again using classic interpolation methods or via the Tween class (or 3rd party tools like tweener).
Coupled with onRollOver/onRollOut event handlers you'll be able to implement the colorize-on-rollover effect with relative ease. The sample preview above illustrates this effect, the code for which comes packaged with your purchase of this versatile
utility.
In addition a class based implementation has also been provided for OOP aficionados. All in all a great tool for any Flash developer to have in his/her arsenal.
free from such constraints and open to wider application. Better yet, this utility was built with ease of use in mind.
Near effortless two-step setup process involves simply copying the script to a folder and referencing the script via an #include statement on the main timeline. Once that's done every movieclip will support the fabulous _grayScale property. Property? You ask. That is precisely the beauty of this utility. After the initial setup, the effect is accessible via the _grayScale property on ANY movieclip instance. Allow me to reiterate... A-N-Y movieClip instance. Hence forth you merely set the property to a value between 0 and 100 inclusive. Set the property to 100 and viola! You've got a full grayscale version of your movieclip. Furthermore you can easily tween the property to fade from color to grayscale and back again using classic interpolation methods or via the Tween class (or 3rd party tools like tweener).
Coupled with onRollOver/onRollOut event handlers you'll be able to implement the colorize-on-rollover effect with relative ease. The sample preview above illustrates this effect, the code for which comes packaged with your purchase of this versatile
utility.
In addition a class based implementation has also been provided for OOP aficionados. All in all a great tool for any Flash developer to have in his/her arsenal.