[問題] 資料篩選
想問一下關於XMLListCollection裡資料篩選的部分要怎麼寫
因為想把道具欄分成好幾欄所以想在讀取XML時就分好
<mx:HTTPService id="src" url="game/item/item.xml" resultFormat="e4x"/>
<mx:XMLListCollection id="all" source="{src.item}"/>
<mx:XMLListCollection id="item" source="{src.items.(@type ==
'item').item}"/>
<mx:XMLListCollection id="equipment" source="{src.items.(@type ==
'equipment').item}"/>
<mx:XMLListCollection id="treasure" source="{src.items.(@type ==
'treasure').item}"/>
XML內容格式
<?xml version="1.0"?>
<itemss>
<items type="item">
<item num="1" name="珍珠奶茶" des="藏有蟑螂的奶茶" effect="" effecttype=""
value="" price="0" pic="@Embed(source='mrt_game/item/pic/1.jpg')"/>
</items>
因為我是照這個網頁的方式來寫
http://blog.minidx.com/2008/07/12/1065.html
卻一直出現錯誤= =
1119: 存取可能未定義的屬性 items (透過靜態類型 mx.rpc.http.mxml:HTTPService 的
參考)。
不知到哪裡寫錯了Q.Q
情各位大大幫我看一下~感恩
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.205.239
推
08/12 17:28, , 1F
08/12 17:28, 1F
→
08/12 17:28, , 2F
08/12 17:28, 2F
→
08/13 00:05, , 3F
08/13 00:05, 3F
→
08/13 00:06, , 4F
08/13 00:06, 4F