Monday, July 7, 2008

Flex : Accessing attributes in XML data passed as ArrayCollection

Suppose this is the XML data you get as
in response to your HTTService :


<?xml version="1.0"?>
<catalog desc="desc3">
<clip desc="desc1">
<title>check</title>
</clip>
<clip desc="desc2">
<title>check2</title>
</clip>
</catalog>



And then, you use the result as the dataprovider
of your datarenderer :

photoFeed = event.result.catalog.clip as ArrayCollection;


Then inside you data renderer, if you want to access the
attributes of a CLIP
node, you have to do this :

t.text = data["desc"];

No comments:

Blog Archive