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!