3
看看這個代碼:爲什麼我無法在Flash CS4的回調方法中訪問組合框?
import mx.core.View;
var accordianPane = my_acc.createSegment("mcElectrical", "panel0", "Electrical", "payIcon");
accordianPane.comboBox.addItem("test");
這增加了一個項目與標籤「測試」在影片剪輯的組合框。它工作得很好。但是,當我在回調函數中放入相同的代碼時,它會失敗。
import mx.core.View;
// Load Cost Guide feed.
var costGuideUrl:String = "http://test/cost-guide.ashx";
var costGuideXml:XML = new XML();
costGuideXml.onLoad = function(success) {
if(success) {
populateAccordian(this);
} else {
// Display error message.
}
};
costGuideXml.load(costGuideUrl);
// Populate Accordian with retrieved XML.
function populateAccordian(costGuideXml:XML) {
var accordianPane = my_acc.createSegment("mcElectrical", "panel0", "Electrical", "payIcon");
accordianPane.comboBox.addItem("test");
// This line definitely executes...
}
任何想法,爲什麼我無法從回調內到達組合框?