【发布时间】:2014-02-22 17:23:44
【问题描述】:
我正在通过 datadic.xml 文件来填充 actionscript 3.0 中的组合框,但我想在前 11 个属性的每个部分之间添加一个中断或标题,然后中断,然后是最后 26 个属性。这是我的 xml 文件的一部分:
<codeSet>
<title>Census: population estimates for Northern Ireland </title>
<subtitle>By country, region and local authority</subtitle>
<txtSource>2011 Census</txtSource>
<txtSource2>2001Census</txtSource2>
<dateStart>2001</dateStart>
<dateEnd>2011</dateEnd>
<code id='94NI'>NORTHERN IRELAND</code>
<code id='N09000001'>Antrim and Newtownabbey</code>
然后 actionscript 加载 xml 并创建一个名为 setLists 的函数,这是一个用于填充组合框的简单循环,但现在我想放一个 break 所以应该是 Northern Ireland(break)Antrim 和 Newtownabbey,然后是 10 (break)等等。动作脚本代码:
function setLists():void
{
var menuLength:int = xmlCodes.code.length();
for (var i:int=0; i<menuLength; i++)
{
myVarList1.addItem({label:xmlCodes.code[i].text(), data:xmlCodes.code[i].@id});
myVarList2.addItem({label:xmlCodes.code[i].text(), data:xmlCodes.code[i].@id});
if (
}
【问题讨论】:
标签: xml actionscript-3 flash combobox