// array
var a:Array = [1, 2, 3];
 
// old-skool multi-dimensional array
var ma:Array = [];
ma[0] = [];
ma[1] = [];
 
// a class for making MDArray's
/*
   #########################################################
   #                                                       #
   #             Multidimensional Array                    #
   #                                                       #
   #########################################################
*/
 
// Taken from Tab Julius' book, Lingo!, put into Director,
// and converted to Flash 5, then Flash MX, and now Flash MX 2004 Professional
// Jesse Warden
// [EMAIL PROTECTED]
 
// Class
 
class jxl.data.MDArray extends Array
{
 public var rows:Number;
 public var cols:Number;
 
 private var totalCells:Number;
 
 function MDArray()
 {
  init.apply(this, arguments);
 }
 
 public function init(pRows:Number, pCols:Number):Void
 {
  rows = pRows;
  cols = pCols;
  
  for(var r=0; r<rows; r++){
   this[r] = [];
   for(var c=0; c<cols; c++){
    this[r][c] = 0;
   }
  }
 }
 
 function setCell(r:Number, c:Number, whichValue):Void
 {
  this[r][c] = whichValue;
 }
 
 function getCell(r:Number, c:Number):Number
 {
  var cellValue = this[r][c]
  return cellValue;
 }
}
 
----- Original Message -----
Sent: Tuesday, March 08, 2005 10:17 AM
Subject: [flexcoders] Question about multidimensional arrays

I have heard its impossible to make a multidimensional arrayin Flex if this is the case whats the best alternative. Like say you want to make an array of buttons say and you want one dimention to be the label and another to be the visiblity whats the best way to go about it?

Reply via email to