Package | com.eqsim.components |
Class | public class SectorDialSmooth |
Inheritance | SectorDialSmooth ![]() ![]() |
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.
Property | Defined By | ||
---|---|---|---|
![]() | backgroundClassName : String
This property gives the class name of the background to use. | SectorDial | |
![]() | centerDotClassName : String
This property gives the class name of the center dot (overlay) to use. | SectorDial | |
![]() | centerVis : 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 | ||
![]() | left2right : Boolean
Determines whether minimum is on the left (left2right == true) or on the right (left2right == false). | SectorDial | |
![]() | maxAngle : Number
Angle of needle when reaches maximum value. | SectorDial | |
![]() | maxVal : Number
Maximum value of the gauge. | SectorDial | |
![]() | minAngle : Number
Angle of needle when reaches minimum value. | SectorDial | |
![]() | minVal : Number
Minimum value of the gauge. | SectorDial | |
![]() | needleClassName : 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 | ||
![]() | nXScale : Number
Scaling factor along the y axis (height) for the needle. | SectorDial | |
![]() | nYScale : Number | SectorDial | |
![]() | showBack : Boolean
Boolean property indicating whether the background graphic is visible (true) or not (false). | SectorDial | |
targVal : Number | SectorDialSmooth | ||
![]() | units : int
Number of units in a full cycle for the dial. | SectorDial | |
val : Number [override]
| SectorDialSmooth |
Property | Defined By | ||
---|---|---|---|
![]() | _backgroundClassName : String = defSectDialBkgnd | SectorDial | |
![]() | bkgndClip : Sprite | SectorDial | |
![]() | _centerDotClassName : String = defSectDialCenter | SectorDial | |
![]() | _centerVis : Boolean = true | SectorDial | |
![]() | dCenterClip : Sprite | SectorDial | |
![]() | dialContainer : Sprite | SectorDial | |
_inX : Boolean | SectorDialSmooth | ||
![]() | _needleClassName : String = defSectDialNeedle | SectorDial | |
![]() | needleClip : Sprite | SectorDial | |
_needleRate : Number = 10 | SectorDialSmooth | ||
![]() | _nXScale : Number = 1 | SectorDial | |
![]() | _nYScale : Number = 1 | SectorDial | |
![]() | _showBack : Boolean = true | SectorDial | |
_targVal : Number | SectorDialSmooth | ||
![]() | _units : Number = 50 | SectorDial | |
_unitsPupd : Number | SectorDialSmooth | ||
![]() | _val : Number = 0 | SectorDial | |
_xTimer : Timer | SectorDialSmooth |
Method | Defined By | ||
---|---|---|---|
SectorDialSmooth | |||
destroy():void | SectorDialSmooth | ||
setTargVal(v:Number):void | SectorDialSmooth |
Method | Defined By | ||
---|---|---|---|
![]() | changeBackground(n:String):void | SectorDial | |
![]() | changeCenterOverlay(n:String):void | SectorDial | |
![]() | changeNeedle(n:String):void | SectorDial | |
configUI():void [override]
configUI
Get the display objects created in preparation of launch. | SectorDialSmooth | ||
draw():void [override]
| SectorDialSmooth | ||
![]() | 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 |
_inX | property |
protected var _inX:Boolean
_needleRate | property |
protected var _needleRate:Number = 10
_targVal | property |
protected var _targVal:Number
_unitsPupd | property |
protected var _unitsPupd:Number
_xTimer | property |
protected var _xTimer:Timer
evtReachTarg | property |
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.
needleRate | property |
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).
public function get needleRate():Number
public function set needleRate(value:Number):void
targVal | property |
targVal:Number
public function get targVal():Number
public function set targVal(value:Number):void
val | property |
val:Number
[override]
public function get val():Number
public function set val(value:Number):void
SectorDialSmooth | () | Constructor |
public function SectorDialSmooth()
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 |