0 Replies Latest reply on Feb 19, 2008 9:38 AM by OffCourse

    Getting data from flex into actionscript and back


      I am using a datagrid which gets its data from an xml file. One of the columns is using a field which I would like to use within Actionscrip so that I can use the strchar function (to select just a part of the text in that field) and then back to the datagrid.

      How do I do this? Normally, with an itemrenderer i would use "source={data.fieldname}" to get the data. But when I open an actionscript instance, I am unable to turn that into a string so that I can use it.

      Another problem I am having with actionscript is that every single example code I try to use that has "var" and "trace" code lines returns errors. Even those copied from tutorials, which should work. Do I need to set up something?

      Source Code
      MXML File

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" creationComplete="catalog.send()">
      <mx:HTTPService url="data/catalog_BCA.xml" useProxy="false" id="catalog" />
      <mx:DataGrid dataProvider="{catalog.lastResult.Import.Auction}" width="100%" height="100%" x="0" bottom="0">
      <mx:DataGridColumn headerText="" itemRenderer="TipoLeilaoRenderer" width="70"/>
      <mx:DataGridColumn headerText="Tipo de Leilão" dataField="SaleTypeName"/>
      <mx:DataGridColumn headerText="Data" dataField="SaleDate"/>
      <mx:DataGridColumn headerText="Date" itemRenderer="DateFormatter"/>
      <mx:DataGridColumn headerText="Local" dataField="BranchName"/>

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Box xmlns:mx=" http://www.adobe.com/2006/mxml" >
      <mx:Script >
      var str:String = {data.SaleCode};

      XML FILE

      <?xml version="1.0" encoding="UTF-8"?>
      <SaleDescription>GE-Direct LISBOA Jan 31 200</SaleDescription>
      <SaleDescription>Online LISBOA Jan 31 200</SaleDescription>


      Can anyone help me with this? Would the code I am trying to use

      Thank you