views:

93

answers:

1

Hi,

I'm trying to connect a datagrid to an HTTPService via a simple external XML document, and this is failing. How would I go about debugging where the problem is arising?

I'm using the following:

<mx:HTTPService id = "licenseService" resultFormat="e4x" url="http://localhost/licenseTest.xml" />

with

<mx:DataGrid horizontalCenter="0" width="476" top="50" dataProvider="{licenseService.lastResult.license}">

I'm relatively new to flex, so basic help would be appreciated.

+2  A: 

Add result event handler for HTTP Service:

<mx:HTTPService id = "licenseService" resultFormat="e4x" url="http://localhost/licenseTest.xml" result="licenseService_resultHandler(event)" />

And define the handler inside <mx:Script>:

private function licenseService_resultHandler(event:ResultEvent):void
{
    trace("Result:", event.result);
}

You can place a breakpoint inside this method and start debugging the data that comes from the server

Hrundik