There's been a long thread about the MXML representation of this.

But I want to point out that, in ActionScript, all those pushes are
inefficient. You should just write

var type_array:Array =
[
    { label: "d4", data: 4 },
    { label: "d6", data: 6 },
    ...
];

- Gordon

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of JesterXL
Sent: Friday, June 17, 2005 12:44 PM
To: Flexcoders
Subject: [flexcoders] AS Array vs. MXML Array

How do you get fine grained control in MXML arrays?  Like, how do I 
represent this in MXML?

var type_array:Array = [];
  type_array.push({label: "d4", data: 4});
  type_array.push({label: "d6", data: 6});
  type_array.push({label: "d8", data: 8});
  type_array.push({label: "d10", data: 10});
  type_array.push({label: "d100", data: 100});
  type_array.push({label: "d12", data: 12});
  type_array.push({label: "d20", data: 20});

I tried:

<mx:Array>
  <mx:Object>
    <mx:String>d4</mx:String>
    <mx:Number>4</mx:Number>
  </mx:Object>
</mx:Array>

And nested that in a dataProvider nested in a ComboBox.  That fails for
my 
cellRenderer, however, because he expects a label and data property
name. 
Since you can't get nested tags attributes, must I use code for such
models?

--JesterXL 




 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to