Welcome, Guest
  • Author Topic: Change over from a simple Xml call to a rpc-Http call ....  (Read 481 times)

    aktell

    • Server what's that
    • *
    • Posts: 16
      • View Profile
      • Email
    Hi there,

    I need to change over from a simple Xml call:

    Code: [Select]
    <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: [Select]
    <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)"/>
    [/b][/size][/size][/size]

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Did you use Charles to see the return of the server?
    happy flashing
    8)
    Ronald

    aktell

    • Server what's that
    • *
    • Posts: 16
      • View Profile
      • Email
    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
    • 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