|
Another way is to create an AS class to encapsulate the repeating object… Like so:
Class YourItem { public var label : String; public var data : Number; public var bool : Boolean;
public function YourItem() { //blank constructor } }
Add xmlns="*"
<mx:Array> <YourItem> <label></label> <data></data> <bool></bool> </YourItem> </mx:Array>
From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
You can do that, but those are unamed properties, hence my question about how to name them. For instance, what if you need to get the to boolean; how do you access it? A for in loop utilizing instanceof to determine if it's a Boolean? What if I had more than one?
----- Original Message ----- From: Mercer, Dustin Sent: Friday, June 17, 2005 4:32 PM Subject: RE: [flexcoders] AS Array vs. MXML Array
You may want to try this instead. I didn’t test this, but I think I have used it before.
<mx:Array> <mx:Object> <mx:String>d4</mx:String> <mx:Number>d4</mx:Number> <mx:Boolean>d4</mx:Boolean> </mx:Object> </mx:Array>
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf
Of Thijs Triemstra | Collab
Hehe..
And would this work?
var theLabel:String = "d4"; var theData:Number = 4; var theBoolean:Boolean = true;
<mx:Array> <mx:Object label=”{String(theLabel)}” data="" flag="{Boolean(theBoolean)}" /> </mx:Array> And if it doesn't work, does that mean that Flex always recognize 'true' as a Boolean and not as a String?
I can't think of a case where it would matter that your 'best-guess' is wrong but just interested..
Thijs
Op 17-jun-2005, om 22:09 heeft Matt Chotin het volgende geschreven:
From:
<mx:Object>
<label>d4</label>
<data>4</data>
</mx:Object> </mx:Array>
<mx:Object label=”d4” data=""
boolean="{Boolean(true)}" /> </mx:Array> size=2 width="100%" align=center tabIndex=-1> From:
· Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
|
- RE: [flexcoders] AS Array vs. MXML Array Mercer, Dustin
- RE: [flexcoders] AS Array vs. MXML Array Abdul Qabiz
- Re: [flexcoders] AS Array vs. MXML Array JesterXL
- RE: [flexcoders] AS Array vs. MXML Array Gordon Smith
- RE: [flexcoders] AS Array vs. MXML Array Mercer, Dustin
- RE: [flexcoders] AS Array vs. MXML Array Matt Chotin
- RE: [flexcoders] AS Array vs. MXML Array Matt Chotin

