# Passing XML to array problems

**URL:** https://forum.kirupa.com/t/passing-xml-to-array-problems/67643
**Category:** Uncategorized
**Created:** [October 18, 2004, 1:53pm UTC](https://forum.kirupa.com/t/passing-xml-to-array-problems/67643 "2004-10-18T13:53:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bananha](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@bananha](https://forum.kirupa.com/u/bananha)
#### Post date: [October 18, 2004, 1:53pm UTC](https://forum.kirupa.com/t/passing-xml-to-array-problems/67643/1 "2004-10-18T13:53:08Z")

</div>

this is my script for my xml and the loads into the array fine for the first frame. but i want to pass the variables in the array to the next frame, which doesnt work right now. any suggestions?

var stories = new Array();  
var responses = new Array();  
var menuNames = new Array();  
var menuURLs = new Array();  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“story.xml”);

function loadXML(loaded) {  
level1 = this.firstChild.firstChild;//story node  
level2 = level1.nextSibling;//responses node  
level3 = level2.nextSibling;//rightnav node  
levelC = level1.firstChild;//characters  
levelR = level2.firstChild;//responses  
levelT = level3.firstChild;//right nav node  
//levelU= levelT.nextSibling.firstChild.nextSibling.firstChild;

```
ttlC = level1.childNodes.length;//number of characters
ttlR = level2.childNodes.length;//number of responses
ttlT = level3.childNodes.length;//number of tabs for right nav
//
//

if (loaded) {
	//characters
	for (var c = 0; c&lt;ttlC; c++) {
		char = levelC.firstChild.nodeValue;
		stories.push(char);
		levelC = levelC.nextSibling;
	}	
	//trace(stories);//displays 6 variables for the array list
	//reponses
	for (var r = 0; r&lt;ttlR; r++) {
		resp = levelR.firstChild.nodeValue;
		responses.push(resp);
		levelR = levelR.nextSibling;
	}		
	//menu tabs
	for (var t = 0; t&lt;ttlT; t++) {
		tabs = levelT.firstChild.firstChild.nodeValue;
		menuNames.push(tabs);
		link= levelT.firstChild.nextSibling.firstChild.nodeValue;
		menuURLs.push(link);
		levelT = levelT.nextSibling;
	}
	//trace(menuURLs);
	this.gotoAndPlay(2);
}

```

}

//trace(stories.length);//displays 0… so i assume this is where the problem is in passing array vairables  
stop();
