开发者

Unable to unload content in XML gallery - AS3

开发者 https://www.devze.com 2022-12-24 14:06 出处:网络
I have an XML gallery and I want in the next button function to \"unload\" all content and load new XML file.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消