Package com.bit101.components
Class public class Meter
Inheritance Meter InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
    damp : Number
Gets / sets the damping value for the meter.
Meter
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    label : String
Gets / sets the label shown on the meter.
Meter
    maximum : Number
Gets / sets the maximum value for the meter.
Meter
    minimum : Number
Gets / sets the minimum value for the meter.
Meter
    showValues : Boolean
Gets / sets whether or not value labels will be shown for max and min values.
Meter
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
    value : Number
Gets / sets the current value for the meter.
Meter
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _damp : Number = .8
Meter
    _dial : Sprite
Meter
  Inherited _enabled : Boolean = true
Component
  Inherited _height : Number = 0
Component
    _label : Label
Meter
    _labelText : String
Meter
    _maximum : Number = 1.0
Meter
    _maxLabel : Label
Meter
    _minimum : Number = 0.0
Meter
    _minLabel : Label
Meter
    _needle : Sprite
Meter
    _needleMask : Sprite
Meter
  Inherited Ronda : Class
Component
    _showValues : Boolean = true
Meter
  Inherited _tag : int = -1
Component
    _targetRotation : Number = 0
Meter
    _value : Number = 0.0
Meter
    _velocity : Number = 0
Meter
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
Meter(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, text:String)
Constructor
Meter
   
draw():void
[override] Draws the visual ui of the component.
Meter
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
   
setSize(w:Number, h:Number):void
[override] Sets the size of the component.
Meter
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
Meter
   
Draws the background of the component.
Meter
   
drawDial(startAngle:Number, endAngle:Number):void
Draws the dial.
Meter
   
drawNeedle():void
Draws the needle.
Meter
   
drawTicks(startAngle:Number, endAngle:Number):void
Draws the tick marks on the dial.
Meter
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
Meter
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onEnterFrame(event:Event):void
Handles the enterFrame event to spring the needle to the target rotation.
Meter
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
update():void
Updates the target rotation of the needle and starts an enterframe handler to spring it to that point.
Meter
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_damp property
protected var _damp:Number = .8

_dial property  
protected var _dial:Sprite

_label property  
protected var _label:Label

_labelText property  
protected var _labelText:String

_maximum property  
protected var _maximum:Number = 1.0

_maxLabel property  
protected var _maxLabel:Label

_minimum property  
protected var _minimum:Number = 0.0

_minLabel property  
protected var _minLabel:Label

_needle property  
protected var _needle:Sprite

_needleMask property  
protected var _needleMask:Sprite

_showValues property  
protected var _showValues:Boolean = true

_targetRotation property  
protected var _targetRotation:Number = 0

_value property  
protected var _value:Number = 0.0

_velocity property  
protected var _velocity:Number = 0

damp property  
damp:Number

Gets / sets the damping value for the meter.


Implementation
    public function get damp():Number
    public function set damp(value:Number):void
label property  
label:String

Gets / sets the label shown on the meter.


Implementation
    public function get label():String
    public function set label(value:String):void
maximum property  
maximum:Number

Gets / sets the maximum value for the meter.


Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimum property  
minimum:Number

Gets / sets the minimum value for the meter.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
showValues property  
showValues:Boolean

Gets / sets whether or not value labels will be shown for max and min values.


Implementation
    public function get showValues():Boolean
    public function set showValues(value:Boolean):void
value property  
value:Number

Gets / sets the current value for the meter.


Implementation
    public function get value():Number
    public function set value(value:Number):void
Constructor Detail
Meter () Constructor
public function Meter(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, text:String)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this Meter.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
text:String — The string to use as the initial text in this component.
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

draw () method  
override public function draw():void

Draws the visual ui of the component.

drawBackground () method  
protected function drawBackground():void

Draws the background of the component.

drawDial () method  
protected function drawDial(startAngle:Number, endAngle:Number):void

Draws the dial.

Parameters

startAngle:Number
 
endAngle:Number
drawNeedle () method  
protected function drawNeedle():void

Draws the needle.

drawTicks () method  
protected function drawTicks(startAngle:Number, endAngle:Number):void

Draws the tick marks on the dial.

Parameters

startAngle:Number
 
endAngle:Number
init () method  
override protected function init():void

Initializes the component.

onEnterFrame () method  
protected function onEnterFrame(event:Event):void

Handles the enterFrame event to spring the needle to the target rotation.

Parameters

event:Event
setSize () method  
override public function setSize(w:Number, h:Number):void

Sets the size of the component. Adjusts height to be 1/2 width.

Parameters

w:Number — The width of the component.
 
h:Number — The height of the component.
update () method  
protected function update():void

Updates the target rotation of the needle and starts an enterframe handler to spring it to that point.