Building the accordion tabs is very easy.  You'll need some extra
work to create the children of the accordion; probably a custom
component instead of the Canvas tag used in the below example.  BTW,
I think I got the basis for this sample code from someone's site,
probably Jester's, but I couldn't find the direct link.

Data.xml:
---------------
<xml>
  <header label="my header 1" />
  <header label="my header 2" />
  <header label="my header 3" />
</xml>

app.mxml:
----------------
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
width="100%" height="100%">

<mx:Model id="myXml" source="Data.xml"/>

<mx:Accordion height="300" width="200">
    <mx:Repeater  id="rp" dataProvider="{myXml.header}">
        <mx:Canvas height="100%" width="100%"
label="{rp.currentItem.label}"/>
    </mx:Repeater>
</mx:Accordion>

</mx:Application>


Enjoy!
Doug


--- In [email protected], "alehrens" <[EMAIL PROTECTED]> wrote:
>
> I'm a newbie to both Flex and FlexCoders...  How would you go
about
> populating an accordian tab/data from an XML file?  Specifically,
I
> have an XML file that contains a label, data and description.  I'd
> like to use the label as the tab of the accordian, then show the
data
> and description inside the accordian.  Is there a clean and simple
way
> to do this?
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to