Package | com.eqsim.components |
Class | public class NumDigits |
Inheritance | NumDigits ![]() |
Property | Defined By | ||
---|---|---|---|
decimalPlaces : int
Number of decimal places (to the right of the decimal point). | NumDigits | ||
digSkinClassName : String | NumDigits | ||
digTint : int
Color of each digit (integer RGB, for example 0xFF0000 for Pure Red). | NumDigits | ||
display : Boolean
Whether or not to display the set value. | NumDigits | ||
evtOverflow : String = onOverflow
Event name for event generated if the value of the display (whole number) exceeds the
number of positions to the left of the decimal point. | NumDigits | ||
leadZero : Boolean
Boolean property true or false, whether or not to pad left of decimal point with zeroes. | NumDigits | ||
numDigs : int
Number of digits. | NumDigits | ||
showBkgnd : Boolean
Whether or not to display the background graphic. | NumDigits | ||
val : *
Get or set the digital display's value. | NumDigits |
Property | Defined By | ||
---|---|---|---|
_decPl : Number = 0 | NumDigits | ||
digClip : MovieClip
MovieClip holding the digit graphics
| NumDigits | ||
digCols : Array
An array of Colors to modify the digit graphics (tint). | NumDigits | ||
digitsContainer : Sprite
Sprite container for the digital display (to make scaling easier). | NumDigits | ||
digs : Array
An array of defDigPlusBkgnd clips, for digits 1 - (numDigs-1). | NumDigits | ||
digSkinClass : Class
The class for the digit skin. | NumDigits | ||
_digSkinClassName : String = defDigSkinClass | NumDigits | ||
_digsOn : Boolean = true | NumDigits | ||
_digTint : int | NumDigits | ||
_leadZero : Boolean = false | NumDigits | ||
_numDigs : Number = 1 | NumDigits | ||
pval : * = 0
A private value used to hold the digital display's value. | NumDigits | ||
_showBkgnd : Boolean = true | NumDigits |
Method | Defined By | ||
---|---|---|---|
NumDigits |
Method | Defined By | ||
---|---|---|---|
arrangeDigits(numOfDigits:int):void
Looks at the number of digits needed (and what is there already), then creates
the digits and places them in the data structures for rendering. | NumDigits | ||
chgDecPlaces(dp:int):void
Changes the number of decimal places displayed. | NumDigits | ||
chgLeadZero(f:Boolean):void
Sets whether or not to pad the left of decimal point with zeroes (default is false). | NumDigits | ||
configUI():void [override]
configUI
Get the display objects created in preparation of launch. | NumDigits | ||
displayDigs(f:Boolean):void
Turn on (true) or off (false) the digital display. | NumDigits | ||
draw():void [override]
| NumDigits | ||
setDigColor(c:Number):void
Sets the tint color of the digits (RGB value). | NumDigits | ||
setVal(v:*):void
Internal routine to change the display value. | NumDigits | ||
updateDisplay():void
Update, the main routine. | NumDigits |
Event | Summary | Defined By | ||
---|---|---|---|---|
Event generated when numeric value is larger (whole numbers) than what can fit in the display to the left of the decimal point. | NumDigits |
_decPl | property |
protected var _decPl:Number = 0
_digSkinClassName | property |
protected var _digSkinClassName:String = defDigSkinClass
_digsOn | property |
protected var _digsOn:Boolean = true
_digTint | property |
protected var _digTint:int
_leadZero | property |
protected var _leadZero:Boolean = false
_numDigs | property |
protected var _numDigs:Number = 1
_showBkgnd | property |
protected var _showBkgnd:Boolean = true
decimalPlaces | property |
decimalPlaces:int
Number of decimal places (to the right of the decimal point).
public function get decimalPlaces():int
public function set decimalPlaces(value:int):void
digClip | property |
protected var digClip:MovieClip
MovieClip holding the digit graphics
digCols | property |
protected var digCols:Array
An array of Colors to modify the digit graphics (tint).
digitsContainer | property |
protected var digitsContainer:Sprite
Sprite container for the digital display (to make scaling easier).
digs | property |
protected var digs:Array
An array of defDigPlusBkgnd clips, for digits 1 - (numDigs-1).
digSkinClass | property |
protected var digSkinClass:Class
The class for the digit skin.
digSkinClassName | property |
digSkinClassName:String
public function get digSkinClassName():String
public function set digSkinClassName(value:String):void
digTint | property |
digTint:int
Color of each digit (integer RGB, for example 0xFF0000 for Pure Red).
public function get digTint():int
public function set digTint(value:int):void
display | property |
display:Boolean
Whether or not to display the set value. This is used to simulate the display on (true) or off (false).
public function get display():Boolean
public function set display(value:Boolean):void
evtOverflow | property |
public var evtOverflow:String = onOverflow
Event name for event generated if the value of the display (whole number) exceeds the number of positions to the left of the decimal point. Negative numbers consume one digit to represent the negative sign. If the number exceeds the space, the component puts all 8s in the display.
leadZero | property |
leadZero:Boolean
Boolean property true or false, whether or not to pad left of decimal point with zeroes.
public function get leadZero():Boolean
public function set leadZero(value:Boolean):void
numDigs | property |
numDigs:int
Number of digits.
public function get numDigs():int
public function set numDigs(value:int):void
pval | property |
protected var pval:* = 0
A private value used to hold the digital display's value.
showBkgnd | property |
showBkgnd:Boolean
Whether or not to display the background graphic.
public function get showBkgnd():Boolean
public function set showBkgnd(value:Boolean):void
val | property |
val:*
Get or set the digital display's value.
public function get val():*
public function set val(value:any):void
NumDigits | () | Constructor |
public function NumDigits()
arrangeDigits | () | method |
protected function arrangeDigits(numOfDigits:int):void
Looks at the number of digits needed (and what is there already), then creates the digits and places them in the data structures for rendering.
Parameters
numOfDigits:int |
chgDecPlaces | () | method |
protected function chgDecPlaces(dp:int):void
Changes the number of decimal places displayed.
Parameters
dp:int — Number of decimal places (0 for none).
|
chgLeadZero | () | method |
protected function chgLeadZero(f:Boolean):void
Sets whether or not to pad the left of decimal point with zeroes (default is false).
Parameters
f:Boolean — Pass in true to pad the display, false not to pad it.
|
configUI | () | method |
override protected function configUI():void
configUI Get the display objects created in preparation of launch. Note that we get called before our constructor, and before we are notified that we are on the stage!
displayDigs | () | method |
protected function displayDigs(f:Boolean):void
Turn on (true) or off (false) the digital display. Note: this does not turn then background off.
Parameters
f:Boolean — Pass in true to show the digits, false to hide them (_visible == false).
|
draw | () | method |
override protected function draw():void
setDigColor | () | method |
protected function setDigColor(c:Number):void
Sets the tint color of the digits (RGB value).
Parameters
c:Number — RGB value of tint color.
|
setVal | () | method |
protected function setVal(v:*):void
Internal routine to change the display value. Note that the internal value may have greater precision than the display since the display is limited to the # of decimal places set.
Parameters
v:* — New value
|
updateDisplay | () | method |
protected function updateDisplay():void
Update, the main routine. This takes the internal value, pval, and translates it into the digital display.
onOverflow | Event |
Event generated when numeric value is larger (whole numbers) than what can fit in the display to the left of the decimal point. Negative numbers consume one digit to represent the negative sign.