I’m using a HorizontalList control with an XML file as a data provider.
This is how the XML looks:
<data>
<zone name="Europe">
.
.
.
</zone>
<zone name="Japan">
<stores>
.
.
.
</stores>
<collections>
<collection id="id1">
<name>xxx</name>
<model>xxx</model>
<hierarchy>xxx</hierarchy>
<thumbnail>assets/xxx.PNG</thumbnail>
</collection>
<collection id="id1Bis">
<name>xxx</name>
<model>xxx</model>
<hierarchy>xxx</hierarchy>
<thumbnail>assets/xxx.PNG</thumbnail>
</collection>
<collection id="id2">
<name>xxx</name>
<model>xxx</model>
<hierarchy>xxx</hierarchy>
<thumbnail>assets/xxx.PNG</thumbnail>
</collection>
<collection id="id2Bis">
<name>xxx</name>
<model>xxx</model>
<hierarchy>xxx</hierarchy>
<thumbnail>assets/xxx.PNG</thumbnail>
</collections>
<clarities>
.
.
.
</clarities>
</zone>
</data>
And this is how my control looks
<mx:XML id="data" source="assets/SOD_division.xml"/>
<mx:HorizontalList
dataProvider="{data.division.(@name=='Japan').collections}"
columnCount="2"
itemRenderer="Renderer"
width="500"
horizontalScrollPolicy="off"
/>
I tried using an array of objects as a dataprovider. The item renderer works and the horizontallist behaves as I expect it to.
However, when I use an xml file, it’s empty….
I don’t know why it’s not working… -_-‘ …
Thanks for any help you can provide =)
Regards,
BS_C3
First thing I notice is that your DP is set as:
But that’s not the structure of your XML. By following your XML example your DP should be:
Now thats going to return an XML object when you probably want an XMLList object in which case your DP should be
or if you don’t care about the local name of the children: