ButtonStates
Kind of class: | public class |
---|---|
Package: | |
Inherits from: |
|
Classpath: | org.asaplibrary.ui.buttons.ButtonStates |
File last modified: | Wednesday, 11 May 2011, 18:43:26 |
Button state options used by ButtonBehavior. The state options use bitwise operators to allow combinations of values.
Bitwise operators are AND (&), OR (|) and XOR (^).
Example
-
Assigment:
var state:uint = 0; state |= ButtonStates.OVER; // state is now OVER state |= ButtonStates.DOWN; // state is now OVER and DOWN
or:var state:uint = ButtonStates.OVER|ButtonStates.DOWN;
Retrieval:var isOver:Boolean; isOver = (state & ButtonStates.UP); // false isOver = (state & ButtonStates.OVER); // true isOver = (state & ButtonStates.DOWN); // true
Summary
Constants
- NONE : uint
- ADDED : uint
- NORMAL : uint
- OVER : uint
- OUT : uint
- UP : uint
- DOWN : uint
- ENABLED : uint
- DISABLED : uint
- SELECTED : uint
- DESELECTED : uint
- CLICK : uint
- DOUBLE_CLICK : uint
- MOUSE_WHEEL : uint
Class methods
-
stateToString
(inState:uint) : String
- Returns the name of the state.
Constants
ADDED
static const ADDED:uint = (1 << 1)
CLICK
static const CLICK:uint = (1 << 11)
DESELECTED
static const DESELECTED:uint = (1 << 10)
DISABLED
static const DISABLED:uint = (1 << 8)
DOUBLE_CLICK
static const DOUBLE_CLICK:uint = (1 << 12)
DOWN
static const DOWN:uint = (1 << 6)
ENABLED
static const ENABLED:uint = (1 << 7)
MOUSE_WHEEL
static const MOUSE_WHEEL:uint = (1 << 13)
NONE
static const NONE:uint
NORMAL
static const NORMAL:uint = (1 << 2)
OUT
static const OUT:uint = (1 << 4)
OVER
static const OVER:uint = (1 << 3)
SELECTED
static const SELECTED:uint = (1 << 9)
UP
static const UP:uint = (1 << 5)
Class methods
stateToString
static function stateToString(inState:uint) : String
Returns the name of the state.
Parameters
inState:state option
Example
-
trace(ButtonStates.stateToString(state));
Returns
- Name of the state.