0 Replies Latest reply on Aug 16, 2012 8:39 AM by wasted bombat

    Parsing xml file

    wasted bombat


      I would like to parse xml file in code. Here is my xml:


          <?xml version="1.0" encoding="UTF-8"?>












      And here is my code


          <?xml version="1.0" encoding="utf-8"?>

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"






                      import mx.events.FlexEvent;

                      protected function label2_creationCompleteHandler(event:FlexEvent):void


                          getDataResult.token = my_file.getData();

                          //here Iam getting an error  "A term is undefined and has no properties."

                          label2.text = getDataResult.lastResult[1].name;   







                  <s:CallResponder id="getDataResult"/>

                  <my_file:My_file id="my_file"/>

                  <!-- Place non-visual elements (e.g., services, value objects) here -->


              <s:Label id="label2" x="140" y="142" creationComplete="label2_creationCompleteHandler(event)"




      I would like to parse an element of my xml and then assign it to my label. But I am getting an error "A term is undefined and has no properties." I am not really sure if this is a good way to parse a xml file. I have seen some tutorials about xml parsing in builder but none really solves my problem. Can anybody help me Iam new and I want to try to make some app based on xml.