【发布时间】:2010-07-12 09:21:20
【问题描述】:
我使用了 Flex in a week 示例,使用下拉菜单将 XML 数据与 XML 节点集配对。
对于我正在创建的项目,我只是将一个仅包含一个节点的 XML 文件拉入我的应用程序。
所以我的问题是,我该如何实现这一目标?
我正在使用 HTTPService 并提取数据,但目前唯一的方法是使用 <s:DropDownList>
我的代码如下:
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="channelList"
url="http://www.spriing.dev/videolist/createxml.php"
showBusyCursor="true">
</s:HTTPService>
</fx:Declarations>
<s:Group>
<mx:Image id="backgroundImg" source="{channelSelection.selectedItem.background_image}" width="100%" height="100%" scaleContent="true"/>
</s:Group>
<s:Group>
<mx:FormItem label="Select Your Channel : ">
<s:DropDownList id="channelSelection" dataProvider="{channelList.lastResult.channels.channel}" labelField="name" width="196"/>
</mx:FormItem>
<s:Label text="{channelSelection.selectedItem.name}" x="0" y="45" width="331"/>
<s:Label text="{channelSelection.selectedItem.description}" x="0" y="72" width="331"/>
<mx:Image source="{channelSelection.selectedItem.logo}" x="2" y="95" />
</s:Group>
提前非常感谢..
【问题讨论】:
-
我不确定我是否理解你的问题 - 你在哪里卡住了 - 你是想摆脱下拉列表吗?
-
是的,没错。我想摆脱下拉列表,让标签在不使用下拉列表的情况下通过 XML 节点拉出。谢谢
-
我的 XML(如果有帮助的话)如下:
Channel One 这是 Channel One 。 ./img/logo_small.jpg ../img/background.jpg
标签: apache-flex flex4