1 Reply Latest reply on Nov 20, 2011 6:47 PM by drkstr_1

    flex 4: help with using repeater & xml to populate images

    garyflex

      problem is flex shows no errors, and when run displays a single broken image

       

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                       xmlns:s="library://ns.adobe.com/flex/spark"

                                       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600" width="800" height="600">

                <fx:Style source="tes5.css"/>

       

        <fx:Declarations>

        <fx:Model id="importXML" source="data/data.xml"/>

        <s:ArrayCollection id="imageArray" source="importXML.image"/>

        </fx:Declarations>

      <mx:HBox id="renderer" width="100%" height="80%">

                <mx:Repeater id="rep" dataProvider="{imageArray}">

                          <mx:Image id="image" source="{rep.currentItem.@src"/>

       

        </mx:Repeater>

      </mx:HBox>

      </s:Application>

       

       

      data.xml
      
      <images>
                <image src="assets/ai_appicon-tn.gif"/>
                <image src="assets/cf_appicon-tn.gif"/>
                <image src="assets/dw_appicon-tn.gif"/>
                <image src="assets/fl_appicon-tn.gif"/>
                <image src="assets/fw_appicon-tn.gif"/>
                <image src="assets/lr_appicon-tn.gif"/>
                <image src="assets/ps_appicon-tn.gif"/>
      </images>