2 Replies Latest reply on Mar 9, 2007 12:12 PM by kloy_fr

    Newsbies Question


      A have a Simple problem but i can't find a solution :

      here is my application source :

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="chargefiche()">

      <mx:HTTPService id="FicheRequest" url="" useProxy="false" method="GET">

      private function chargefiche():void

      <mx:Panel x="31" y="29" width="394" height="287" layout="absolute" title="test">
      <mx:Label x="10" y="10" width="354" height="227" id="FicheLabel"/>



      The FicheRequest result looks like that :

      And id like to print "coucou" inside the label FicheLabel... is it possible ?
      I've spent a lot of time on this and i cant success...

      Thx in advance.
        • 1. Re: Newsbies Question
          ntsiii Level 3
          Flex data calls are asynchronous, so you cannot access the data in the same function in which you invoke send(). You must use a resultHandler. Also, set resultFormat="e4x". Put your data in an instance variable:
          [Bindable]private var _xmlData:XML;

          <mx:HTTPService id="FicheRequest" resultFormat="e4x" result="onResult(event)" ..>

          private function onResult(oEvent:ResultEvent):void{
          _xmlData = XML(oEvent.result);

          <mx:Label id="FicheLabel" text="{_xmlData.fiche.text()}"/>


          • 2. Re: Newsbies Question
            kloy_fr Level 1
            it works fine now... thanks A LOT ...