HilightButton
| Kind of class: | class |
|---|---|
| Inherits from: | EventButton < EventMovieClip < MovieClip |
| Classpath: | org.asapframework.ui.buttons.HilightButton |
| File last modified: | Sunday, 08 October 2006, 23:38:06 |
Class to link to a movieclip to create a button with animated hilight behaviour.
The timeline is expected to have 4 labels: "up", "over", "on" and "out", in that order.
There has to be a "stop();" frame script on the first frame, but on no other frames.
As its base class, EventButton, a movieclip named "hitArea_mc" can be used to define the hit area of the button.
The default state is the first frame.
On rollover, the timeline advances from the "over" label to the "on" label, and stays there if the mouse is still over the clip.
On rollout, the timeline advances from the "out" label to the end, and stops at the first frame.
If the mouse is moved out of the clip before the timeline has reached the "on" label, the timeline continues all the way until the "on" frame, and then continues further until the end. So a short move over a clip that has this class, results in a full hilight of the clip.
If the clip has an intro for first display, the "up" frame will not be at the first frame. In order for the clip to move back to the "up" label when it has reached the end, an extra frame script must be added in the last frame: "gotoAndStop("up");".
The timeline is expected to have 4 labels: "up", "over", "on" and "out", in that order.
There has to be a "stop();" frame script on the first frame, but on no other frames.
As its base class, EventButton, a movieclip named "hitArea_mc" can be used to define the hit area of the button.
The default state is the first frame.
On rollover, the timeline advances from the "over" label to the "on" label, and stays there if the mouse is still over the clip.
On rollout, the timeline advances from the "out" label to the end, and stops at the first frame.
If the mouse is moved out of the clip before the timeline has reached the "on" label, the timeline continues all the way until the "on" frame, and then continues further until the end. So a short move over a clip that has this class, results in a full hilight of the clip.
If the clip has an intro for first display, the "up" frame will not be at the first frame. In order for the clip to move back to the "up" label when it has reached the end, an extra frame script must be added in the last frame: "gotoAndStop("up");".
Summary
Constructor
Class properties
- DEFAULT_FRAME_ON : String
- DEFAULT_FRAME_UP : String
- DEFAULT_FRAME_OVER : String
- DEFAULT_FRAME_OUT : String
Instance properties
- mFrameOn : String
- mFrameUp : String
- mFrameOver : String
- mFrameOut : String
- mDoOutAnimation : Boolean
- mIsAnimating : Boolean
- mHilightFrame : Number
- mForceHilight : Boolean
- isLit : Boolean
- True if the current frame is the hilight frame
Instance properties inherited from EventButton
Instance properties inherited from EventMovieClip
Instance methods
- hilight : Void
- Go directly to the hilight frame.
- unHilight : Void
- Go directly to the "up" frame
- checkAnimation : Void
- enterFrame handler that checks if animation has to continue
- toString : String
Instance methods inherited from EventButton
Event handlers
- onLoad : Void
- onRollOver : Void
- Handle rollover event.
- onRollOut : Void
- Handle rollout event.
Event handlers inherited from EventButton
Constructor
HilightButton
function HilightButton (
)
Class properties
DEFAULT_FRAME_ON
static private DEFAULT_FRAME_ON:String = "on"
(read)
DEFAULT_FRAME_OUT
static private DEFAULT_FRAME_OUT:String = "out"
(read)
DEFAULT_FRAME_OVER
static private DEFAULT_FRAME_OVER:String = "over"
(read)
DEFAULT_FRAME_UP
static private DEFAULT_FRAME_UP:String = "up"
(read)
Instance properties
isLit
isLit:Boolean
(read)
True if the current frame is the hilight frame
mDoOutAnimation
private mDoOutAnimation:Boolean = false
(read)
mForceHilight
private mForceHilight:Boolean = false
(read)
mFrameOn
private mFrameOn:String = DEFAULT_FRAME_ON
(read)
mFrameOut
private mFrameOut:String = DEFAULT_FRAME_OUT
(read)
mFrameOver
private mFrameOver:String = DEFAULT_FRAME_OVER
(read)
mFrameUp
private mFrameUp:String = DEFAULT_FRAME_UP
(read)
mHilightFrame
private mHilightFrame:Number
(read)
mIsAnimating
private mIsAnimating:Boolean = false
(read)
Instance methods
checkAnimation
private function checkAnimation (
) : Void
enterFrame handler that checks if animation has to continue
hilight
function hilight (
) : Void
Go directly to the hilight frame.
unHilight
function unHilight (
) : Void
Go directly to the "up" frame
Event handlers
onRollOut
function onRollOut (
) : Void
Handle rollout event.
Can also be used to animate out of the hilight state.
Can also be used to animate out of the hilight state.
Overrides:
onRollOver
function onRollOver (
) : Void
Handle rollover event.
Can also be used to animate to the hilight state.
Can also be used to animate to the hilight state.
Overrides: