diff options
Diffstat (limited to 'bPod/com/oop/SelectionSystem.as')
| -rw-r--r-- | bPod/com/oop/SelectionSystem.as | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/bPod/com/oop/SelectionSystem.as b/bPod/com/oop/SelectionSystem.as new file mode 100644 index 0000000..2c89bf0 --- /dev/null +++ b/bPod/com/oop/SelectionSystem.as @@ -0,0 +1,89 @@ +/*
+ Manages a set of UI Buttons and controls selection state
+*/
+
+class com.oop.SelectionSystem extends MovieClip
+{
+
+//----------------------------------------------------------------------------------
+
+
+
+ // Data array passed in at instantiation
+ private var systemData:Array;
+
+ // Linkage name of button clip
+ private var exportName:String;
+
+ // Store our current state as a number
+ private var currentSelection:Number;
+
+ // Store references to our items
+ private var listItems:Array;
+
+
+
+
+
+//----------------------------------------------------------------------------------
+
+ public function SelectionSystem()
+ {
+
+ }
+
+//----------------------------------------------------------------------------------
+
+ public function doInit(_systemData:Array, _exportName:String):Void
+ {
+ systemData = _systemData;
+ exportName = _exportName;
+ listItems = new Array();
+ attachButtonItems();
+
+ }
+
+
+
+ public function setSelection(_id:Number):Void
+ {
+ if(currentSelection!=_id)
+ {
+ listItems[currentSelection].setUnselected();
+ currentSelection = _id;
+ listItems[currentSelection].setSelected();
+ doAction();
+ }
+ }
+
+ private function attachButtonItems():Void {
+ //override
+ }
+
+
+ private function doAction():Void
+ {
+ //override
+ }
+
+
+ // Getter/setters
+
+ public function getSystemData():Array
+ {
+ return systemData;
+ }
+
+ public function getCurrentSelection():Number
+ {
+ return currentSelection;
+ }
+
+ public function setCurrentSelection(_val:Number):Void
+ {
+ currentSelection = _val;
+ }
+
+
+
+}
\ No newline at end of file |
