Packagecom.eqsim.components
Classpublic class RoundDialSmooth
InheritanceRoundDialSmooth Inheritance RoundDial Inheritance fl.core.UIComponent

This class is an extension of RoundDial that provides round dial functionality with a rate-limited needle (based on a user-specified needle rate). Developers can set its value in two ways. First, by setting the val property to have the dial jump immediately to that value. Second, by setting the targVal property, the dial will reach the target value based on the set needle rate (needleRate). For convenience, the gauge generates an event, onTargetArrival when it reaches the target value (only if set using targVal).

To simulate the smooth needle movement, this component updates the needle approximately every 1/20th of a second (note: because it uses Flash's Timer() this interval can be up to twice as slow if the frame rate is set around 20 fps, due to "features" of the setInterval implementation). Therefore, if you have more than a few of these components on the stage, you may find that it slows down other processes. If you need many of these on the Stage at once, you might consider rewriting this to centralize the needle update and need for all the timers.

Users can change the appearance (skin) of the hand by modifying: centerDotClassName, center of the dial by modifying: needleClassName, the background graphic by modifying: backgroundClassName.

Showing the dial center and background are optional.



Public Properties
 PropertyDefined By
 InheritedbackgroundClassName : String
This property gives the class name of the background to use.
RoundDial
 InheritedcenterDotClassName : String
This property gives the class name of the center dot (overlay) to use.
RoundDial
 InheritedcenterVis : Boolean
Boolean property indicating whether the center graphic is visible (true) or not (false).
RoundDial
  evtReachTarg : String = onReachTarg
Property that holds the string name of the event generated by this component.
RoundDialSmooth
 InheritedneedleClassName : String
This property gives the class name of the needle to use.
RoundDial
  needleRate : Number
The rate the needle travels when the gauge is set using targVal property.
RoundDialSmooth
 InheritednXScale : Number
Scaling factor along the y axis (height) for the needle.
RoundDial
 InheritednYScale : Number
RoundDial
 InheritedshowBack : Boolean
Boolean property indicating whether the background graphic is visible (true) or not (false).
RoundDial
  targVal : Number
RoundDialSmooth
 Inheritedunits : int
Number of units in a full cycle for the dial.
RoundDial
  val : Number
[override]
RoundDialSmooth
Protected Properties
 PropertyDefined By
 Inherited_backgroundClassName : String = defRoundDialBkgnd
RoundDial
 InheritedbkgndClip : Sprite
RoundDial
 Inherited_centerDotClassName : String = defRoundDialCenter
RoundDial
 Inherited_centerVis : Boolean = true
RoundDial
 InheriteddCenterClip : Sprite
RoundDial
 InheriteddialContainer : Sprite
RoundDial
  _inX : Boolean
RoundDialSmooth
 Inherited_needleClassName : String = defRoundDialNeedle
RoundDial
 InheritedneedleClip : Sprite
RoundDial
  _needleRate : Number = 10
RoundDialSmooth
 Inherited_nXScale : Number = 1
RoundDial
 Inherited_nYScale : Number = 1
RoundDial
 Inherited_showBack : Boolean = true
RoundDial
  _targVal : Number
RoundDialSmooth
 Inherited_units : Number = 50
RoundDial
  _unitsPupd : Number
RoundDialSmooth
 Inherited_val : Number = 0
RoundDial
  _xTimer : Timer
RoundDialSmooth
Public Methods
 MethodDefined By
  
RoundDialSmooth
  
destroy():void
Removes internal listeners and memory associated with the component.
RoundDialSmooth
  
setTargVal(v:Number):void
RoundDialSmooth
Protected Methods
 MethodDefined By
 Inherited
changeBackground(n:String):void
RoundDial
 Inherited
changeCenterOverlay(n:String):void
RoundDial
 Inherited
changeNeedle(n:String):void
RoundDial
  
configUI():void
[override] configUI Get the display objects created in preparation of launch.
RoundDialSmooth
  
draw():void
[override]
RoundDialSmooth
 Inherited
setNeedle(v:Number):void
Sets the needle to the passed in value v.
RoundDial
  
xCbk(te:TimerEvent):void
Used as callback to update the needle based on increment appropriate for set needle speed.
RoundDialSmooth
Property Detail
_inXproperty
protected var _inX:Boolean

_needleRateproperty 
protected var _needleRate:Number = 10

_targValproperty 
protected var _targVal:Number

_unitsPupdproperty 
protected var _unitsPupd:Number

_xTimerproperty 
protected var _xTimer:Timer

evtReachTargproperty 
public var evtReachTarg:String = onReachTarg

Property that holds the string name of the event generated by this component. This must be set through the component property panel or programmatically through the initObject parameter of attachMovie/createClassObject.

needleRateproperty 
needleRate:Number

The rate the needle travels when the gauge is set using targVal property. The rate is in units per second. You can change this property to change the rate, but not during needle movement (in that case, use setVal() to fix the needle position, adjust the rate, and set the new target rate).


Implementation
    public function get needleRate():Number
    public function set needleRate(value:Number):void
targValproperty 
targVal:Number


Implementation
    public function get targVal():Number
    public function set targVal(value:Number):void
valproperty 
val:Number[override]


Implementation
    public function get val():Number
    public function set val(value:Number):void
Constructor Detail
RoundDialSmooth()Constructor
public function RoundDialSmooth()

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

destroy()method 
public function destroy():void

Removes internal listeners and memory associated with the component.

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

setTargVal()method 
public function setTargVal(v:Number):void

Parameters

v:Number

xCbk()method 
protected function xCbk(te:TimerEvent):void

Used as callback to update the needle based on increment appropriate for set needle speed.

Parameters

te:TimerEvent