Shine Effect Extender
Let's look at the internal structure of the ShineEffect object.
Any ShineEffect contains 3 objects:
- source - a Sprite object that contains shined objects.
- shine mask - an alpha mask.
- effect - a Bitmap object (it contains "snapshot" of shined objects). It is placed over source and is masked by shine mask.
You can override the look of the Shine Effect using extender property.
Extender is an object with a few optional properties:
- alphas:Array - an array of light alphas to be used in the shine mask gradient. You can specify up to 15 values. For each alpha, be sure you specify a corresponding ratios value.
- ratios:Array - an array of alpha distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the alpha is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.
- extraSpace:Number - a number of pixels to increase the shine mask size (width and height). Define the extraSpace parameter if the effect uses a space outside the bounding rectangle (blur, glow etc).
- init:Function(source:Sprite, effect:Bitmap):void - this function is called at initialization of the effect.
- update:Function(t:Number,source:Sprite, effect:Bitmap):void - this function is called within an internal onEnterFrame handler.
t is the percentage of the effect play cycle. The value 0 represents the begin of the effect, and the value 1 represents the end of the effect.