[Bindable]public var _xmlVar:XML;

 

private function init():void{

 _xmlVa = testID.result.(@now=='today')[0]; //NOTE the array[0]
brackets. 

...

 

All e4x expessions return an XMLList, even if there is only one node, so
you must specify that node toput it in an XML variable.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of sailorsea21
Sent: Thursday, February 05, 2009 10:28 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XML - What var type can I use for my XML nodes?

 

Hi everyone, I have the following:

<mx:XML id="testID" format="e4x" source="xml/test.xml"/>
<mx:Text text="{testID.result.(@now=='today').date}"/>

What var type can I use for "testID.result.(@now=='today')" to simply 
my text string?

I would like to have the following:

[Bindable]
public var xmlvar:String = testID.result.(@now=='today');

<mx:Text text="{xmlvar.date}"/>

Thanks.

David



Reply via email to