Packagecom.eqsim.components
Classpublic class NumDigits
InheritanceNumDigits Inheritance fl.core.UIComponent

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.



Public Properties
 PropertyDefined 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
Protected Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
NumDigits
Protected Methods
 MethodDefined 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
  
Update, the main routine.
NumDigits
Events
 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
Property Detail
_decPlproperty
protected var _decPl:Number = 0

_digSkinClassNameproperty 
protected var _digSkinClassName:String = defDigSkinClass

_digsOnproperty 
protected var _digsOn:Boolean = true

_digTintproperty 
protected var _digTint:int

_leadZeroproperty 
protected var _leadZero:Boolean = false

_numDigsproperty 
protected var _numDigs:Number = 1

_showBkgndproperty 
protected var _showBkgnd:Boolean = true

decimalPlacesproperty 
decimalPlaces:int

Number of decimal places (to the right of the decimal point).


Implementation
    public function get decimalPlaces():int
    public function set decimalPlaces(value:int):void
digClipproperty 
protected var digClip:MovieClip

MovieClip holding the digit graphics

digColsproperty 
protected var digCols:Array

An array of Colors to modify the digit graphics (tint).

digitsContainerproperty 
protected var digitsContainer:Sprite

Sprite container for the digital display (to make scaling easier).

digsproperty 
protected var digs:Array

An array of defDigPlusBkgnd clips, for digits 1 - (numDigs-1).

digSkinClassproperty 
protected var digSkinClass:Class

The class for the digit skin.

digSkinClassNameproperty 
digSkinClassName:String


Implementation
    public function get digSkinClassName():String
    public function set digSkinClassName(value:String):void
digTintproperty 
digTint:int

Color of each digit (integer RGB, for example 0xFF0000 for Pure Red).


Implementation
    public function get digTint():int
    public function set digTint(value:int):void
displayproperty 
display:Boolean

Whether or not to display the set value. This is used to simulate the display on (true) or off (false).


Implementation
    public function get display():Boolean
    public function set display(value:Boolean):void
evtOverflowproperty 
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.

leadZeroproperty 
leadZero:Boolean

Boolean property true or false, whether or not to pad left of decimal point with zeroes.


Implementation
    public function get leadZero():Boolean
    public function set leadZero(value:Boolean):void
numDigsproperty 
numDigs:int

Number of digits.


Implementation
    public function get numDigs():int
    public function set numDigs(value:int):void
pvalproperty 
protected var pval:* = 0

A private value used to hold the digital display's value.

showBkgndproperty 
showBkgnd:Boolean

Whether or not to display the background graphic.


Implementation
    public function get showBkgnd():Boolean
    public function set showBkgnd(value:Boolean):void
valproperty 
val:*

Get or set the digital display's value.


Implementation
    public function get val():*
    public function set val(value:any):void
Constructor Detail
NumDigits()Constructor
public function NumDigits()

Method Detail
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.

Event Detail
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.