Skip to main content
August 22, 2012
Answered

Calling XML using function parameters

  • August 22, 2012
  • 1 reply
  • 634 views

I am looking to call some xml but I would like it to be different depending on what is typed into the function paramerter when it is called.

So far I have

function ParseXML(BrandXMLList:XML, Brand:String):void{

     var brandlist:XMLList = BrandXMLList.Brand1.customer.name;

etc

etc

etc

}

I am looking to get the Brand1 section to change to Brand 1,2,3,etc , this shall be passed in the functions Brand parameter.

Thanks

This topic has been closed for replies.
Correct answer Ned Murphy

Try...

var brandlist:XMLList = BrandXMLList[Brand].customer.name;

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
August 22, 2012

Try...

var brandlist:XMLList = BrandXMLList[Brand].customer.name;

August 22, 2012

Thats brilliant, Thanks Ned

Ned Murphy
Legend
August 22, 2012

You're welcome Dan