Because <mx:String> under an object makes it a property.  You cannot have to properties on an object with the same name.

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thijs Triemstra | Collab
Sent: Friday, June 17, 2005 1:51 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] AS Array vs. MXML Array

 

So why does adding the <mx:String/> node give a compiler error?

 

Thijs

 

 

Op 17-jun-2005, om 22:45 heeft Abdul Qabiz het volgende geschreven:



[snip]

<mx:Array>

    <mx:Object>

        <mx:String>d4</mx:String>

        <mx:Number>d4</mx:Number>

        <mx:Boolean>d4</mx:Boolean>

    </mx:Object>

</mx:Array>

 

[/snip]

 

that works,  a array with an object would be created with three properties with these names:

 

String, Boolean and Number with values d4, d4 and d4 respectively.

 

If you add one more <mx:String /> node, you will see compiler error.

 

<mx:Array>

    <mx:Object>

        <mx:String>d4</mx:String>

        <mx:Number>d4</mx:Number>

        <mx:Boolean>d4</mx:Boolean>

        <mx:String>d5</mx:String>

    </mx:Object>

</mx:Array>

 

 

But why would want to do this way, it doesn't look logically correct to me.

 

-abdul

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mercer, Dustin
Sent: Saturday, June 18, 2005 2:10 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] AS Array vs. MXML Array

Oops, that won’t work at all L  I am not sure if this will work either, but it doesn’t throw any compiler errors (but neither did the wrong one…) .  There are other ways also depending on what you are trying to do.  Are you trying to avoid AS altogether or just trying the different options?

 

<mx:Array>

    <mx:Object>

        <label><mx:String>d4</mx:String></label>

        <data><mx:Number>4</mx:Number></data>

        <bool><mx:Boolean>true</mx:Boolean></bool>

    </mx:Object>

</mx:Array>

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mercer, Dustin
Sent: Friday, June 17, 2005 1:33 PM
To: flexcoders@yahoogroups.com
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: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Thijs Triemstra | Collab
Sent: Friday, June 17, 2005 1:26 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] AS Array vs. MXML Array

 

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:

 

We make a “best-guess” as to whether it should be a string or a number or a boolean.  Sometimes people get frustrated because we guess number and they wanted string J


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Thijs Triemstra | Collab
Sent: Friday, June 17, 2005 1:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] AS Array vs. MXML Array

What about the :Number and :String difference in his Array, aren't the label and data properties both Strings now..?

Thijs

Op 17-jun-2005, om 21:51 heeft Matt Chotin het volgende geschreven:

 

<mx:Array>

  <mx:Object>

    <label>d4</label>

    <data>4</data>

  </mx:Object>

</mx:Array>

Alternatively:

<mx:Array>

  <mx:Object label=”d4” data="" boolean="{Boolean(true)}" />

</mx:Array>

Matt


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Friday, June 17, 2005 12:44 PM
To: Flexcoders
Subject: [flexcoders] AS Array vs. MXML Array

[EMAIL PROTECTED]  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




[EMAIL PROTECTED]
 

·  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

 

 

 

 


Yahoo! Groups Links



 

 



Yahoo! Groups Links

Reply via email to