# XML - How tell xmlObject forget the nodes?

**URL:** <https://forum.kirupa.com/t/xml-how-tell-xmlobject-forget-the-nodes/193897>\
**Category:** flash\
**Created:** [July 19, 2006, 3:17am UTC](https://forum.kirupa.com/t/xml-how-tell-xmlobject-forget-the-nodes/193897 "2006-07-19T03:17:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedro\_paulo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pedro_paulo/32/2017_2.png) [@pedro\_paulo](https://forum.kirupa.com/u/pedro_paulo)\
**Post date:** [July 19, 2006, 3:17am UTC](https://forum.kirupa.com/t/xml-how-tell-xmlobject-forget-the-nodes/193897/1 "2006-07-19T03:17:22Z")

</div>

Hi, guys!

I have to use a very long function 3 or 4 times. This function builds a list using attachMovie method.

The code to load the XML list is:

> 

var brXML:XML = new XML();  
[COLOR=Gray]// I use the tipoDisco var to change the xml I want to load…[/COLOR]  
[COLOR=Blue]var [/COLOR]tipoDisco:[COLOR=Blue]String[/COLOR] = [COLOR=Green]“trabalhos/xml/todos.xml”[/COLOR];  
brXML.[COLOR=Blue]ignoreWhite[/COLOR] = [COLOR=Blue]true[/COLOR];  
brXML.[COLOR=Blue]load/COLOR;  
[COLOR=Gray]// on load…[/COLOR]  
brXML[COLOR=Blue].onLoad [/COLOR]= [COLOR=Blue]functionCOLOR=Black[/COLOR][/COLOR][COLOR=Black] [/COLOR]{  
[COLOR=Blue]if COLOR=Black {[/COLOR][/COLOR]  
geraLista(this);  
[COLOR=Blue][COLOR=Black]} [/COLOR]else [COLOR=Black]{[/COLOR][/COLOR]  
[COLOR=Blue]trace[/COLOR]([COLOR=Green]“XML was not loaded”[/COLOR]);  
}  
};

Then I have 3 buttons with the actions…

> 

[COLOR=Gray]// asking a new XML document…[/COLOR]  
[COLOR=Blue]this[/COLOR].producer\_btn.[COLOR=Blue]onRelease[/COLOR] = [COLOR=Blue]function/COLOR {  
tipoDisco = [COLOR=Green]“trabalhos/xml/produtor.xml”[/COLOR];  
brXML.[COLOR=Blue]load/COLOR;  
};

When I click the button, it loads the correct XML and rebuild the list, but the old list CONTINUES above the new one. How can I say “Hey, flash! Forget the old XML and, now, use THIS, AND JUST THIS XML to build the new list” ?

Is it possible? :jail: I´ve tried the XML.removeNode method but it does not work.

Any Idea? :red:

Thanks a lot to everyone!
