More XML nodes
Date: Jun 4, 2007
Views: 2057
Question:
Is there anyway to parse more xml nodes. Description and data are the only current ones, when I try to parse new ones I add I just get undefined. I really love the component., but I need to get 2 more things to parse. Any help would be appreciated.
Answer:
| andreit (Admin) |
Hi, what you can do is add all of your content to the data node and parse it in Flash. You can use a comma or some other character to separate values, then just use slit(",") in flash. Sample xml structure. <data>value 1, value 2, value 3, value 4</data> Inside flash you can use event listeners to get the data. var eventListener = new Object(); eventListener.ITEM_ON_RELEASE = function(evnt){ var myArray = new Array(); myArray = evnt.target.data.split(","); trace(myArray[0]); // returns value 1 trace(myArray[1]); // returns value 2 } myFlow.addEventListener("ITEM_ON_RELEASE", eventListener); |