header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
krntom
Points:40
Posts:0

6/16/2010 3:15:37 AM

Title: HTTPService XML not working.


Hi All,

I've just pull out 2 XML data as http service, but one data not working..
or data not displayed on datagrid.
Could someone give me advice on this..

Thanks



<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			import mx.rpc.events.ResultEvent;

			[Bindable]
			private var docs2:ArrayCollection;

			private function serviceHandler(event:ResultEvent):void
			{
				docs2=event.result.employees.employee;
			}
		]]>
	</mx:Script>
	<mx:HTTPService id="service" url="http://krntom:8080/05/data2.xml" result="serviceHandler(event)"/>

    <mx:Panel title="DataGrid">
        <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{docs2}">
            <mx:columns>
                <mx:DataGridColumn dataField="name" headerText="Name"/>
                <mx:DataGridColumn dataField="phone" headerText="Phone"/>
                <mx:DataGridColumn dataField="email" headerText="Email"/>
            </mx:columns>
        </mx:DataGrid>
    </mx:Panel>
</mx:Application>  



and the 'data2.XML'




<?xml version="1.0"?>
        <employee>
            <name>Christina Coenraets</name>
            <phone>555-219-2270</phone>
            <email>ccoenraets@fictitious.com</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Joanne Wall</name>
            <phone>555-219-2012</phone>
            <email>jwall@fictitious.com</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Maurice Smith</name>
            <phone>555-219-2012</phone>
            <email>maurice@fictitious.com</email>
            <active>false</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>mjones@fictitious.com</email>
            <active>true</active>
        </employee>




1
krntom
Points: 40
Posts:0
6/16/2010 4:43:43 AM



Sorry, i've just found the solution, add this parameter in <mx:.. > statement.




<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="absolute"
  creationComplete="service.send();">



Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+7 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions