diff options
| author | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
|---|---|---|
| committer | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
| commit | 79670053c7247d3a49b607960efd284e93f057e5 (patch) | |
| tree | 9617f6eefa38b2686ae409bf75cc27a340444eda /bPod/com/oop/GridSelectionSystem.as | |
| parent | c53827d5d044ae5ca7ebb27acb404b7a8988918e (diff) | |
install.pl
Diffstat (limited to 'bPod/com/oop/GridSelectionSystem.as')
| -rw-r--r-- | bPod/com/oop/GridSelectionSystem.as | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/bPod/com/oop/GridSelectionSystem.as b/bPod/com/oop/GridSelectionSystem.as new file mode 100644 index 0000000..c9694ca --- /dev/null +++ b/bPod/com/oop/GridSelectionSystem.as @@ -0,0 +1,49 @@ +import com.oop.SelectionSystem;
+
+class com.oop.GridSelectionSystem extends SelectionSystem
+{
+ private var itemsPerRow:Number = 3;
+ private var currentRow:Number = 0;
+ private var currentColumn:Number = 0;
+
+ //space between rows and columns
+ private var horizSpace:Number = -6; //60;
+ private var vertSpace:Number = 0; //50;
+
+ public function GridSelectionSystem() {}
+
+ private function attachButtonItems():Void {
+ //get placement object according to counts
+ for (var i:Number = 0; i < systemData.length; i++) {
+ updateGrid(i);
+ var item:MovieClip = this.attachMovie(exportName, "Item_" + i, i );
+ item.init(this, i, systemData[i], getItemPositionObj());
+ listItems.push(item);
+ }
+ }
+
+
+
+ private function updateGrid(_index:Number) {
+ if(!(_index % itemsPerRow)) { currentColumn = 0; currentRow++; }
+ else { currentColumn++; }
+ }
+
+
+ private function getItemPositionObj():Object {
+ var obj:Object = new Object();
+ obj.horizSpace = horizSpace;
+ obj.vertSpace = vertSpace;
+ obj.grid_x = currentColumn;
+ obj.grid_y = currentRow;
+ return obj;
+ }
+
+
+
+ private function selectedData():MovieClip {
+ return systemData[ getCurrentSelection() ];
+ }
+
+
+}
\ No newline at end of file |
