我正在尝试使用 Flash builder 4.6 为手机(android)开发字典程序
问题是搜索按钮不起作用我尝试了不同的代码但没有任何成功,对闪存编程也很陌生
请注意,这个 xml 文件更长,但我不得不减少它以使其更好地阅读
这是我的 xml 文件:
<list>
<Dictionary>
<id>1</id>
<term>ok</term>
<defin>Advanced Audio Coding</defin>
</Dictionary>
<Dictionary>
<id>6</id>
<term>absolute address</term>
<defin>a fixed location in the computer's memory.</defin>
</Dictionary>
<Dictionary>
<id>7</id>
<term>absolute URL</term>
<defin>a URL that contains </defin>
</Dictionary>
主页查看代码:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Home"
creationComplete="srv.send()">
<fx:Declarations>
<s:HTTPService id="srv" url="assets/Dictionary.xml"
result="data=srv.lastResult.list.Dictionary"/>
</fx:Declarations>
<s:titleContent>
<s:TextInput id="key" width="100%"/>
</s:titleContent>
<s:actionContent>
<s:Button icon="@Embed('assets/search.png')" click="srv.send()"/>
</s:actionContent>
<s:List id="list" top="0" bottom="0" left="0" right="0"
dataProvider="{srv.lastResult.list.Dictionary}"
labelField="term"
change="navigator.pushView(Details, list.selectedItem)">
</s:List>
</s:View>
详细视图 :
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
title=" {data.term}">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:actionContent>
<s:Button label="BACK" click="navigator.popToFirstView()"/>
</s:actionContent>
<s:TextAreatext="{data.defin}" />
</s:View>
提前致谢