Packagecom.eqsim.components
Classpublic class SectorDialSmooth
InheritanceSectorDialSmooth Inheritance SectorDial Inheritance fl.core.UIComponent

This class is an extension of SectorDial that provides sector 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, onReachTarg 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 of the hand by modifying: defSectorDialHand, center of the dial by modifying: defSectorDialCenter, the background graphic by modifying: defSectorDialBkgnd.

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.
SectorDial
 InheritedcenterDotClassName : String
This property gives the class name of the center dot (overlay) to use.
SectorDial
 InheritedcenterVis : Boolean
Boolean property indicating whether the center graphic is visible (true) or not (false).
SectorDial
  evtReachTarg : String = onReachTarg
Property that holds the string name of the event generated by this component.
SectorDialSmooth
 Inheritedleft2right : Boolean
Determines whether minimum is on the left (left2right == true) or on the right (left2right == false).
SectorDial
 InheritedmaxAngle : Number
Angle of needle when reaches maximum value.
SectorDial
 InheritedmaxVal : Number
Maximum value of the gauge.
SectorDial
 InheritedminAngle : Number
Angle of needle when reaches minimum value.
SectorDial
 InheritedminVal : Number
Minimum value of the gauge.
SectorDial
 InheritedneedleClassName : String
This property gives the class name of the needle to use.
SectorDial
  needleRate : Number
The rate the needle travels when the gauge is set using targVal property.
SectorDialSmooth
 InheritednXScale : Number
Scaling factor along the y axis (height) for the needle.
SectorDial
 InheritednYScale : Number
SectorDial
 InheritedshowBack : Boolean
Boolean property indicating whether the background graphic is visible (true) or not (false).
SectorDial
  targVal : Number
SectorDialSmooth
 Inheritedunits : int
Number of units in a full cycle for the dial.
SectorDial
  val : Number
[override]
SectorDialSmooth
Protected Properties
 PropertyDefined By
 Inherited_backgroundClassName : String = defSectDialBkgnd
SectorDial
 InheritedbkgndClip : Sprite
SectorDial
 Inherited_centerDotClassName : String = defSectDialCenter
SectorDial
 Inherited_centerVis : Boolean = true
SectorDial
 InheriteddCenterClip : Sprite
SectorDial
 InheriteddialContainer : Sprite
SectorDial
  _inX : Boolean
SectorDialSmooth
 Inherited_needleClassName : String = defSectDialNeedle
SectorDial
 InheritedneedleClip : Sprite
SectorDial
  _needleRate : Number = 10
SectorDialSmooth
 Inherited_nXScale : Number = 1
SectorDial
 Inherited_nYScale : Number = 1
SectorDial
 Inherited_showBack : Boolean = true
SectorDial
  _targVal : Number
SectorDialSmooth
 Inherited_units : Number = 50
SectorDial
  _unitsPupd : Number
SectorDialSmooth
 Inherited_val : Number = 0
SectorDial
  _xTimer : Timer
SectorDialSmooth
Public Methods
 MethodDefined By
  
SectorDialSmooth
  
destroy():void
SectorDialSmooth
  
setTargVal(v:Number):void
SectorDialSmooth
Protected Methods
 MethodDefined By
 Inherited
changeBackground(n:String):void
SectorDial
 Inherited
changeCenterOverlay(n:String):void
SectorDial
 Inherited
changeNeedle(n:String):void
SectorDial
  
configUI():void
[override] configUI Get the display objects created in preparation of launch.
SectorDialSmooth
  
draw():void
[override]
SectorDialSmooth
 Inherited
setNeedle(v:Number):void
Sets the needle to the passed in value v.
SectorDial
  
xCbk(te:TimerEvent):void
Used as callback to update the needle based on increment appropriate for set needle speed.
SectorDialSmooth
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
SectorDialSmooth()Constructor
public function SectorDialSmooth()

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

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