Check out this code:
import mx.core.View;
var accordianPane = my_acc.createSegment("mcElectrical", "panel0", "Electrical", "payIcon");
accordianPane.comboBox.addItem("test");
This adds an item with label "test" to a combo box in a movie clip. It works perfectly fine. However, when I put the same code in a callback function, it fails.
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...
}
Any ideas on why I can't get to the combobox from inside the callback?