2009-10-13 59 views

回答

2

看看是否有效:(用适当的标签名称替换'item')。

comboBox.selectedItem = XML(xmlListCol.source.item.(@id == requiredIndex)); 

如果没有,用这个:

var list:XMLList = xmlListCol.source; 
var index:Number = -1; 
for(i = 0; i < list.length(); i++) 
    if(XML(list[i])[email protected] == requiredID) 
    { 
    index = i; 
    break; 
    } 
if(index != -1) 
    comboBox.selectedIndex = index; 
else 
    //deal with it 
+0

我做的for循环。丑,但它的工作.. – luca 2009-10-14 16:48:15

+0

你尝试单线的东西 - 它的工作? – Amarghosh 2009-10-15 04:46:25

+0

顶部没有工作,但buttom工作对我来说好一点,虽然我不得不唠叨它。 谢谢! – Babyangle86 2010-03-13 09:51:43

相关问题