Package | com.williammalone |
Class | public class Digit |
Inheritance | Digit flash.display.Sprite |
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9 |
NONE
.
See also
Property | Defined By | ||
---|---|---|---|
color : uint
The color of the digit. | Digit | ||
height : Number [override]
The height of the digit. | Digit | ||
padding : Number [read-only]
The space between segments in pixels. | Digit | ||
thickness : Number [read-only]
The thickness of each segment. | Digit | ||
value : int
The value of the digit which is either an integer 0-9 or a value of NONE. | Digit | ||
width : Number [override] [read-only]
The width of the digit (based on a ratio of the height and cannot be set). | Digit |
Method | Defined By | ||
---|---|---|---|
Digit()
Creates a new Digit instance. | Digit |
Constant | Defined By | ||
---|---|---|---|
A : int = 0 [static]
Constant associated with the segment at the top of the digit. | Digit | ||
B : int = 1 [static]
Constant associated with the segment at the top-right of the digit. | Digit | ||
C : int = 2 [static]
Constant associated with the segment at the bottom-right of the digit. | Digit | ||
D : int = 3 [static]
Constant associated with the segment at the bottom of the digit. | Digit | ||
E : int = 4 [static]
Constant associated with the segment at the bottom-left of the digit. | Digit | ||
F : int = 5 [static]
Constant associated with the segment at the top-left of the digit. | Digit | ||
G : int = 6 [static]
Constant associated with the segment at the middle of the digit. | Digit | ||
NONE : int = -1 [static]
Constant specifing all segments are in the off state. | Digit |
color | property |
color:uint
The color of the digit.
public function get color():uint
public function set color(value:uint):void
height | property |
height:Number
[override] The height of the digit.
public function get height():Number
public function set height(value:Number):void
padding | property |
padding:Number
[read-only] The space between segments in pixels.
public function get padding():Number
thickness | property |
thickness:Number
[read-only] The thickness of each segment.
public function get thickness():Number
value | property |
value:int
The value of the digit which is either an integer 0-9 or a value of NONE
.
The default value is
.NONE
public function get value():int
public function set value(value:int):void
width | property |
width:Number
[read-only] [override] The width of the digit (based on a ratio of the height and cannot be set).
public function get width():Number
Digit | () | Constructor |
public function Digit()
Creates a new Digit instance.
A | Constant |
public static const A:int = 0
Constant associated with the segment at the top of the digit.
B | Constant |
public static const B:int = 1
Constant associated with the segment at the top-right of the digit.
C | Constant |
public static const C:int = 2
Constant associated with the segment at the bottom-right of the digit.
D | Constant |
public static const D:int = 3
Constant associated with the segment at the bottom of the digit.
E | Constant |
public static const E:int = 4
Constant associated with the segment at the bottom-left of the digit.
F | Constant |
public static const F:int = 5
Constant associated with the segment at the top-left of the digit.
G | Constant |
public static const G:int = 6
Constant associated with the segment at the middle of the digit.
NONE | Constant |
public static const NONE:int = -1
Constant specifing all segments are in the off state.
package { import com.williammalone.Digit; import fl.controls.ComboBox; public class DigitExample extends Digit { private var digit:Digit; private var digitHeight:Number = 100; private var digitColor:uint = 0x557755; public function DigitExample() { digit = new Digit(); digit.color = digitColor; addChild(digit); createComboBox(); } private function createComboBox():void { var changeDigit:ComboBox = new ComboBox(); changeDigit.width = 120; changeDigit.x = 40; changeDigit.y = 10; changeDigit.prompt = "Select a digit"; changeDigit.addItem( { label: "0", data:0 } ); changeDigit.addItem( { label: "1", data:1 } ); changeDigit.addItem( { label: "2", data:2 } ); changeDigit.addItem( { label: "3", data:3 } ); changeDigit.addItem( { label: "4", data:4 } ); changeDigit.addItem( { label: "5", data:5 } ); changeDigit.addItem( { label: "6", data:6 } ); changeDigit.addItem( { label: "7", data:7 } ); changeDigit.addItem( { label: "8", data:8 } ); changeDigit.addItem( { label: "9", data:9 } ); addChild(changeDigit); changeDigit.addEventListener(Event.CHANGE, onDigitChanged); } private function onDigitChanged(e:Event):void { digit.value = changeDigit.selectedItem.data; } } }