I have an XML gallery and I want in the next button function to "unload" all content and load new XML file.
So far I use this code:
function navigateToRight(evt:MouseEvent):void{
if (thumbsHolder.numChildren > 0){
while (thumbsHolder.numChildren) {
thumbsHolder.removeChildAt(0)开发者_如何转开发;
}
removeloaded();}
loadXml("2.xml");
}
Where removeloaded
function is loader.unload();
Unfortunately when i press next button I can see the new xml file is loaded but the items are from the previous xml file.
Solution founded!
I had to re-declare the Array that holds my XML objects everytime I load a new XML file.
精彩评论