From 79670053c7247d3a49b607960efd284e93f057e5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Aug 2013 17:14:26 -0500 Subject: install.pl --- bPod/com/oop/SelectionSystem.as | 89 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 bPod/com/oop/SelectionSystem.as (limited to 'bPod/com/oop/SelectionSystem.as') 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 -- cgit v1.2.3-70-g09d2