Parsing xml file
hello
i parse xml file in code. here xml:
<?xml version="1.0" encoding="utf-8"?>
<people>
<person>
<name>james</name>
<age>24</age>
</person>
<person>
<name>cynthia</name>
<age>33</age>
</person>
</people>
and here code
<?xml version="1.0" encoding="utf-8"?>
<s:application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:my_file="services.my_file.*"
applicationdpi="160">
<fx:script>
<![cdata[
import mx.events.flexevent;
protected function label2_creationcompletehandler(event:flexevent):void
{
getdataresult.token = my_file.getdata();
//here iam getting error "a term undefined , has no properties."
label2.text = getdataresult.lastresult[1].name;
}
]]>
</fx:script>
<fx:declarations>
<s:callresponder id="getdataresult"/>
<my_file:my_file id="my_file"/>
<!-- place non-visual elements (e.g., services, value objects) here -->
</fx:declarations>
<s:label id="label2" x="140" y="142" creationcomplete="label2_creationcompletehandler(event)"
text="{getdataresult.lastresult[0].name}"/>
</s:application>
i parse element of xml , assign label. getting error "a term undefined , has no properties." not sure if way parse xml file. have seen tutorials xml parsing in builder none solves problem. can me iam new , want try make app based on xml.
More discussions in Using Flash Builder
adobe
Comments
Post a Comment