HELP NEEDED!button should create new xml data

I am having sort of the same problem that was in a previous post but didn’t want the two to be confused…I created a dynamic textfield and a dynamic button that loads xml content inside of it. I would like to create one long xml file that will load a single node that I request into the text field. I want the text field to load the next node when a button is pressed but I can’t figure out how to do it. Here is what I have so far. :confused:



//creates a blank textbox set to render html, depth of 96, x coordinates of 10, y coordinates of 100, width of 300, height of 300

var txtbox:TextField = _root.createTextField("theTextBox",96,15,100,300,0);
theTextBox.html=true;
theTextBox.background=false;
theTextBox.border=false;
theTextBox.label.condenseWhite=true;
theTextBox.multiline=true;
theTextBox.wordWrap=true;
theTextBox.autoSize=true;

//create some formatting for our theTextBox
myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 14;
myTextFormat.color=0xFFFFFF;//white
theTextBox.setNewTextFormat(myTextFormat);

//temporary dynamic textfield where the CDATA content goes and than is transferred to the txtbox for HTML formatting reasons
var tmpbox = _root.createTextField("my_txt", 1, 15, 10, -20, -22);
tmpbox.html=true;

//Create Next Button by making a simple button in an external movieclip called  nextbutton.swf
_root.createEmptyMovieClip("next_button",100);
next_button.loadMovie("nextbutton.swf", "next_button");
next_button._x = 650 ;
next_button._y = 510 ;

//loads content for the txtbox and the temporary my_txt dynamically via xml
var xmlContent:XML = new XML("xml/mrbs_cvmc_010.xml");
xmlContent.ignoreWhite = true;
xmlContent.onLoad = function(success:Boolean) {
	if (success) 
		{		
	var screen = xmlContent.firstChild.firstChild;
	var text_content:Array = screen.childNodes;
	for (var i=0; i<text_content.length; i++)
	{
	var currentContent:XMLNode = text_content*;
	}
		next_button.onRelease = function()
		{
	tmpbox.htmlText = currentContent;//creates the content generated for the next button
	txtbox.htmlText = tmpbox.text;//transfers the tmpbox to the txtbox
		  }
	tmpbox.htmlText = xmlContent.firstChild.firstChild.firstChild;//creates the content first seen on screen
	txtbox.htmlText = tmpbox.text;//transfers the var tmpbox to the txtbox
	}
}
			
xmlContent.load("xml/mrbs_cvmc_010.xml");	



Here is the xml structure that I am using…The idea that I am going for is to make a training module that loads a different screen of xml content everytime you press the next button so that you can create a lot of training content by just reusing xml.

<?xml version="1.0" encoding="UTF-8"?>
<lesson>
	<screen>
		<text_content>
			   <![CDATA[<div>Upon completion of this lesson, you will:</div>]]>
		</text_content>
		<media_file/>
		<prompt_text>Click the next button to continue.
		</prompt_text>
		<popup term=""/>
		<glossary term=""/>
	</screen>
	<screen>
		<text_content>
			   <![CDATA[<div>Upon completion of this lesson, you will:</div>]]>
		</text_content>
		<media_file/>
		<prompt_text>Click the next button to continue.
		</prompt_text>
		<popup term=""/>
		<glossary term=""/>
	</screen>
</lesson>

When the next or previous button is hit a different xml node is supposed to show up. All it does it cycle through all the nodes till it gets to the last one.

Any help on coding would be great…any help at ALL would be great.
Thanks.