Title: Message
You asked the "best way" so I'd use an Array of Objects, not an Array of Arrays:
 
    var buttonData:Array = [ { label: "OK", visible: true }, { label: "Cancel", visible: false } ];
 
You'd access data as buttonData[0].label, etc. You could use this array as the dataProvider in a <Repeater> tag to create the buttons.
 
- Gordon
-----Original Message-----
From: Tracy Spratt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 8:40 AM
To: [email protected]
Subject: RE: [flexcoders] Question about multidimensional arrays

Since Arrays are objects, you just create an array of arrays. For a simple 2 dimensional array, you can even access the elements like this: aMyArray[n][n], so aMyArray[0][0] would be the first "row", the first "column" in that row".

 

Note: you can't create elements using this syntax.  You must create the array of column values, then push it onto the array of rows.

 

Tracy

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 10:17 AM
To: [email protected]
Subject: [flexcoders] Question about multidimensional arrays

 

I have heard its impossible to make a multidimensional array in 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