This class implements a simple round dial gauge. Developers can set its
value by setting the val
property to have the
dial jump immediately to that value. If you want to have the needle transition smoothly,
use the sub-class RoundDialSmooth
in which you can set the needle rate.
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
.
The component also provides properties to bring in attached graphics based
on movie clip linkage ID's. This allows the developer to have multiple instances
on the Stage with different looks.
Showing the dial center and background skins are optional.
protected var _backgroundClassName:String = defRoundDialBkgnd
protected var _centerDotClassName:String = defRoundDialCenter
protected var _centerVis:Boolean = true
protected var _needleClassName:String = defRoundDialNeedle
protected var _nXScale:Number = 1
protected var _nYScale:Number = 1
protected var _showBack:Boolean = true
protected var _units:Number = 50
protected var _val:Number = 0
backgroundClassName:String
This property gives the class name of the background to use.
Implementation public function get backgroundClassName():String
public function set backgroundClassName(value:String):void
protected var bkgndClip:Sprite
centerDotClassName:String
This property gives the class name of the center dot (overlay) to use.
Implementation public function get centerDotClassName():String
public function set centerDotClassName(value:String):void
centerVis:Boolean
Boolean property indicating whether the center graphic is visible (true) or not (false).
Implementation public function get centerVis():Boolean
public function set centerVis(value:Boolean):void
protected var dCenterClip:Sprite
protected var dialContainer:Sprite
needleClassName:String
This property gives the class name of the needle to use. The Sprite should be centered at the point you want it to rotate.
Implementation public function get needleClassName():String
public function set needleClassName(value:String):void
protected var needleClip:Sprite
nXScale:Number
Scaling factor along the y axis (height) for the needle.
Implementation public function get nXScale():Number
public function set nXScale(value:Number):void
nYScale:Number
Implementation public function get nYScale():Number
public function set nYScale(value:Number):void
showBack:Boolean
Boolean property indicating whether the background graphic is visible (true) or not (false).
Implementation public function get showBack():Boolean
public function set showBack(value:Boolean):void
units:int
Number of units in a full cycle for the dial.
Implementation public function get units():int
public function set units(value:int):void
val:Number
Current value of the dial (where needle is set). Set this property to change the displayed
value immediately.
Implementation public function get val():Number
public function set val(value:Number):void
public function RoundDial()
protected function changeBackground(n:String):void
Parameters
protected function changeCenterOverlay(n:String):void
Parameters
protected function changeNeedle(n:String):void
Parameters
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!
override protected function draw():void
protected function setNeedle(v:Number):void
Sets the needle to the passed in value v. Change to the new value is immediate. This routine does not change the needle value -- use val
to do that.
Parameters
| v:Number — New value to display for needle.
|
Thu Dec 15 2011, 12:05 AM -05:00