Problem retrieving XML data via Flex/ActionScript

Can anyone tell me why the following ActionScript code doesn't work please? I simply want to display the XML "id" in the Alert box, but it doesn't work and I've no idea why.

Any help appreciated. Thanks in advance.
// ACTIONSCRIPT
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       creationComplete="windowedapplication1_creationCompleteHandler(event)">
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.events.FlexEvent;
            import mx.rpc.events.ResultEvent;
            
            // fetch ID and display in Alert window
            protected function xmlService_resultHandler(event:ResultEvent):void
            {
                var id:String    =    event.result.data.id;
                Alert.show(id, 'ID');
            }

            // retrieve XML data
            protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
            {
                xmlService.send();
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:HTTPService id="xmlService"
                       url="URL"
                       method="GET"
                       useProxy="false"
                       resultFormat="e4x"
                       result="xmlService_resultHandler(event)"/>
    </fx:Declarations>
</s:WindowedApplication>

// XML
<?xml version="1.0"?>
<data>
  <id>products</id>
</data>

Open in new window

DReade83Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

scooby_56Commented:
try to trace some values.

trace(event)
trace(event.result.data)
trace(event.result.data.data.id)
0
DReade83Author Commented:
It's OK, I've sorted it.
var data:XML   =  event.result as XML;
var id:String  =  data.id;

Alert.show(id, 'ID');

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.