0 Replies Latest reply on May 11, 2007 9:41 AM by Clarence_69

    charge image from xml

    Clarence_69
      I
      Hello at All,
      create the script in Flex and I wish to import the image from XML script. The script works for the text but not for image. ote I made a parsig of xml and it works very well. I start from php code to build the xml. However I post the xml code. Could to correct the script to import the image? Thanks. I remember you the script works and the data are charged but the not the image. I hope you help me :) Thanks

      Flex Builder 2.0 script:

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" horizontalAlign="left" width="1566" layout="horizontal"
      initialize="selectedItem=DG.dataProvider[0]">

      <mx:Script>
      var selectedItem:Object;

      </mx:Script>


      <mx:Model id="ItemModel" source=" http://127.0.0.1/FLEX/Parse/bin/dat.php"/>


      <mx:Panel title="News" horizontalAlign="left" verticalAlign="bottom" layout="horizontal">
      <mx:DataGrid id="DG" width="210" dataProvider="{ItemModel.item}" change="selectedItem=DG.selectedItem" textAlign="center" enabled="true">
      <mx:columns>
      <mx:DataGridColumn dataField="ID" headerText="ID" width="20"/>
      <mx:DataGridColumn dataField="Codice" headerText="Codice" width="60"/>
      <mx:DataGridColumn dataField="desc" headerText="description" visible="false"/>
      <mx:DataGridColumn dataField="price" headerText="Price" width="90"/>
      <mx:DataGridColumn dataField="image" headerText="image" width="90" visible="false"/>




      </mx:columns>
      </mx:DataGrid>
      </mx:Panel>
      <mx:Panel title="Dettaglio" width="311" height="193" horizontalAlign="right" fontWeight="bold" color="#ffffff">
      <mx:FormItem>
      </mx:FormItem>
      <mx:Label text="{DG.selectedItem.desc}" fontWeight="bold" color="#804000" fontSize="12" width="264" height="140"/>
      </mx:Panel>
      <mx:Panel title="Dettaglio" width="186" height="193" horizontalAlign="right" fontWeight="bold" color="#ffffff">
      <mx:FormItem>
      </mx:FormItem>
      <mx:Image source="{selectedItem.image}" width="150" height="140"/>
      </mx:Panel>





      </mx:Application>


      the xml file:
      <?xml version="1.0" encoding="utf-8" ?>
      - <elenco>
      <item ID="1" Codice="ASDF" desc="software" price="26" />
      <item ID="2" Codice="FFR" desc="sw descrittivo" price="50" />
      <item ID="3" Codice="GFT" desc="Frutta ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddddddd" price="80" />
      </elenco>