A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Change over from a simple Xml call to a rpc-Http call ....

  1. #1
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117

    Change over from a simple Xml call to a rpc-Http call ....

    I need to change over from a simple Xml call:

    Code:
    <mx:XML id="urlsGeneral" source="http://www.mySite.com//.../AFS.xml"/>
    to a rpc-Http call which is updating the readout if Xml is changed at any time.

    The most important item yet a very simple one: I need this only to be displayed in a title etc, and NOT a datagrid or else example below.

    title="{urlsGeneral.urlGeneral.(@name==0).age}

    I tried a lot today, but just can't get it right as the id="urlsGeneral" is always the problem.

    Any help would be appriciated !!! Thanks in advance. regards aktell

    Code:
    <urlsGeneral>
    
    <urlGeneral>
    
    <name>Jim</name>
    
    <age>32</age>
    
    </urlGeneral>
    
    <urlGeneral>
    
    <name>Jim</name>
    
    <age>32</age>
    
    </urlGeneral>
    
    </urlsGeneral>
    
    
    Another call:
    
    	<mx:Script>
    	<![CDATA[
    
    	import mx.collections.ArrayCollection;
    	import mx.rpc.events.ResultEvent;
    	
    	public var myData:ArrayCollection;
    	
    	privat function myHttpService_resultHandler(event:ResultEvent):void {
    
    	myData = event.result.urlsGeneral.urlGeneral;
    
    	}
    	]]>
    	</mx:Script>
    
    	<mx:HTTPService
    	id="myHttpService"
    	url="http://www.mySite.com/..../AFS.xml"
    	result="myHttpService_resultHandler(event)"/>

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117
    Hi again,

    These days there are more questions than answers on any forum, and very seldom anybody shares the answer if they lucky enough to work it out so here is my answer for the above question.

    Change over from a simple Xml call to a rpc-Http call ....

    I had it all along as a commend noted: // Removed [0] on single node !

    So instead of title="{urlsGeneral.urlGeneral.(@name==0).age} it would be now title="{resultObj.urlsGeneral.urlGeneral.[0].age} and now it works perfectly well. I hope that one or the other of you can use the answer and the code !!! regards aktell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center