0 Replies Latest reply on May 27, 2008 11:19 AM by agentCooper08

    XML and Air Issues

      Hi guys, first time poster so I apologize if this is a basic question! I am creating a Media cataloging application to run as a desktop application through Air, I initially built this as a Flex web app but have decided I want it as a standalone. Anyway my problem is this, in the web version I was using the following code:

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="srv.send()" xmlns:ns1="com.dougmccune.containers.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #2CE1AC]" width="1281">
      <mx:HTTPService id="srv" url="dvdLibrary.xml"/>

      <mx:DataGrid x="336" y="57" dataProvider="{srv.lastResult.dvdList.dvd}" id="dg" width="935" height="354">
      <mx:DataGridColumn headerText="Title" dataField="title"/>
      <mx:DataGridColumn headerText="Studio" dataField="studio"/>
      <mx:DataGridColumn headerText="Released" dataField="releaseDate"/>
      <mx:DataGridColumn headerText="Runtime" dataField="runtime"/>
      <mx:DataGridColumn headerText="Colour" dataField="color"/>
      <mx:DataGridColumn headerText="Aspect Ratio" dataField="aspectRatio"/>

      The above code uses the XML file to populate the dataGrid (which I am sure you know already! :) ), however when I port this to an Air app, it no longer works. I have tried changing the <mx:HTTPService> tag and attributes to the <mx:XML source="pathtoXML.xml" id="srv"/> and <mx:Model source="pathtoXML.xml" id="srv"/> but neither works.

      Can anyone shed any light? I also get and error saying something about creationComplete send() is not a function?

      Is there a very different way of achieving this in Air?

      Thanks in advance!