How do I look for the name of a node that must stored in a variable?

Hi. I am trying to write a simple flash app looks for a for certain node in an xml file. The particular node is stored in a variable so that the node can be changed dynamically.How would I write this? so far I have the following code but it doesnt seem to be working. I get this error
1151: A conflict exists with definition diffLevel in namespace internal.

How would I write this correctly?

[FONT=Fixedsys]var diffLevel:String = new String;
var diffLevel= “trdrugbreaks”;[/FONT]
[FONT=Fixedsys][/FONT]

[FONT=Fixedsys]var xmlURL:URLRequest = new URLRequest(“testObject.xml”);
var xmlLoader:URLLoader = new URLLoader(xmlURL);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);[/FONT]
[FONT=Fixedsys]function xmlLoaded(event:Event) {
var dataXML = XML(event.target.data);

trace(dataXML.productCodes.diffLevel);

}[/FONT]
[FONT=Fixedsys][/FONT]

maybe just typed var 2 times… don’t know if theres something more, but try it this way:

var diffLevel:String = new String;
diffLevel= “trdrugbreaks”;

once you create a variable, you don’t “var” again to change it’s value, doing that you are telling flash to create another… in your case with the same name - diffLevel.

hope this helps

yeah its still not working.
by typing this: trace(dataXML.productCodes.diffLevel);
I want it to actually trace this
trace(dataXML.productCodes.trdrugbreaks);
It can’t be hardcoded because the node is going to be different every tiem the its activated.

i did take the extra var off. but it didnt fix it.

try:
[AS]trace(dataXML.productCodes.child(diffLevel));[/AS]

Thanks that worked perfectly. I need to get up on my action script 3.

groovy… glad that helped out…