AQBlink
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Author: | Arthur Clemens |
| Classpath: | org.asapframework.util.actionqueue.AQBlink |
| File last modified: | Thursday, 12 October 2006, 11:19:40 |
ActionQueue methods to make a movieclip blink.
Summary
Class properties
- START_VALUE : Number
- Start animation value to be returned to the perform function.
- END_VALUE : Number
- End animation value to be returned to the perform function.
- PI2 : Number
- MASK_OFFSCREEN_X : Number
Class methods
- blink (inMC:MovieClip, inCount:Number, inFrequency:Number, inMaxAlpha:Number, inMinAlpha:Number, inStartAlpha:Number, inDuration:Number, inEffect:Function) : ActionQueuePerformData
- maskBlink (inMC:MovieClip, inCount:Number, inFrequency:Number, inHideAtStart:Boolean, inDuration:Number, inEffect:Function) : ActionQueuePerformData
- When you have multiple objects that should simply be hidden while blinking, a simple solution is to use a mask and put all objects under the mask.
Class properties
END_VALUE
static private END_VALUE:Number = 1
(read)
End animation value to be returned to the perform function.
MASK_OFFSCREEN_X
static MASK_OFFSCREEN_X:Number = -9999
(read)
PI2
static private PI2:Number = 2 * Math.PI
(read)
START_VALUE
static private START_VALUE:Number = 0
(read)
Start animation value to be returned to the perform function.
Class methods
blink
static function blink (
inMC:MovieClip,
inCount:Number,
inFrequency:Number,
inMaxAlpha:Number,
inMinAlpha:Number,
inStartAlpha:Number,
inDuration:Number,
inEffect:Function) : ActionQueuePerformData
Parameters:
inMC :
movieclip to blink
inCount :
the number of times the clip should blink (the number of cycles, where each cycle is a full sine curve)
inFrequency :
number of blinks per second
inMinAlpha :
the lowest alpha when blinking; when no value is passed the current inMC's _alpha is used
inMaxAlpha :
the highest alpha when blinking; when no value is passed the current inMC's _alpha is used
inStartAlpha:
(optional) the starting alpha; if not given, max alpha is used
inDuration :
(optional: pass either inDuration or inCount - if inDuration is given, inCount will be ignored) length of blinking in seconds; when 0, blinking is infinite, otherwise the movement will be stopped as soon as the duration has passed; in seconds
inEffect :
(optional) An effect function, for instance one of the mx.transitions.easing methods. Arguments to pass the effect function may be appended as a comma-separated list.
Returns:
- True (this method has an onEnterFrame) (to flag optimization for ActionQueue).
Example:
- This example lets a clip blink 4 times, with a frequency of 6 blinks per second, with a alpha value of 100 as maximum visibility and and a miminum visibility of alpha 10:
queue.addAction( AQBlink.blink, blink_mc, 2, 6, 100, 10, 100);
Usage note:
- Note that
blinkuses _alpha to set the visibility, not _visible.
Implementation note:
- When blinking has finished, the movieclip is set to its original (starting) alpha.
maskBlink
static function maskBlink (
inMC:MovieClip,
inCount:Number,
inFrequency:Number,
inHideAtStart:Boolean,
inDuration:Number,
inEffect:Function) : ActionQueuePerformData
When you have multiple objects that should simply be hidden while blinking, a simple solution is to use a mask and put all objects under the mask. Then you only have to control the mask to set the visibility of its contents. But masks cannot be given an alpha value, so you cannot use blink.
maskBlink moves the mask off screen (x position to MASK_OFFSCREEN_X). Parameters:
inMC :
movieclip to blink
inCount :
the number of times the clip should blink (the number of cycles, where each cycle is a full sine curve)
inFrequency :
number of blinks per second
inHideAtStart:
(optional) if true the blinking starts with the clip set to invisible; if false it starts with the clip set to visible; default is true (visible)
inDuration :
(optional: pass either inDuration or inCount - if inDuration is given, inCount will be ignored) length of blinking in seconds; when 0, blinking is infinite, otherwise the movement will be stopped as soon as the duration has passed; in seconds
inEffect :
(optional) An effect function, for instance one of the mx.transitions.easing methods. Arguments to pass the effect function may be appended as a comma-separated list.
Returns:
- True (this method has an onEnterFrame) (to flag optimization for ActionQueue).
Example:
- This example hides a mask movieclip 10 times with a frequency of 5 blinks a second, starting out visible:
queue.addAction( AQBlink.maskBlink, mask_mc, 10, 5, true );
Implementation note:
- When blinking has finished, the movieclip is set to its original (starting) location.