# Next and previous buttons XML. Please Help!

**URL:** <https://forum.kirupa.com/t/next-and-previous-buttons-xml-please-help/260066>\
**Category:** flash\
**Created:** [May 12, 2008, 11:09am UTC](https://forum.kirupa.com/t/next-and-previous-buttons-xml-please-help/260066 "2008-05-12T11:09:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispas](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wispas](https://forum.kirupa.com/u/wispas)\
**Post date:** [May 12, 2008, 11:09am UTC](https://forum.kirupa.com/t/next-and-previous-buttons-xml-please-help/260066/1 "2008-05-12T11:09:05Z")

</div>

i currently have a xml file that has been loaded into the flash:

> 

\<?xml version=“1.0”?\>  
\<news\>  
\<story\>  
\<headline\> Godzilla Attacks LA! \</headline\>  
\<descriptions\>Equipped with a Japanese Mind-control device, the giant monster has attacked important harbours along the California coast. President to take action. \</descriptions\>  
\</story\>  
\<story\>  
\<headline\> Bigfoot Spotted at M.I.T. Dining Area \</headline\>  
\<descriptions\>The beast was seen ordering a Snapple in the dining area on Tuesday. In a related story, Kirupa Chinnathambi, an MIT engineering student has been reported missing. \</descriptions\>  
\</story\>  
\<story\>  
\<headline\> London Angel Saves England \</headline\>  
\<descriptions\>The “London Angel” known only as “Kit” has saved the U.K. yet again. Reports have stated that she destroyed every single Churchill bobble-head dog in the country. A great heartfilled thank you goes out to her. \</descriptions\>  
\</story\>  
\<story\>  
\<headline\> Six-eyed Man to be Wed to an Eight-armed Woman \</headline\>  
\<descriptions\>Uhhhmmm… No comment really… just a little creepy to see them together… \</descriptions\>  
\</story\>  
\<story\>  
\<headline\> Ahmed’s Birthday Extravaganza! \</headline\>  
\<descriptions\>The gifted youngster’s birthday party should be a blast. He is turning thirteen and has requested a large cake, ice cream, and a petting zoo complete with pony rides. \</descriptions\>  
\</story\>  
\</news\>

everything is working in the flash file with the current actionscript:

> 

function loadXML(loaded) {  
if (loaded) {  
\_root.headline = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.descriptions = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
name\_txt.text = \_root.headline;  
comment\_txt.text = \_root.descriptions;  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“books.xml”);

I want to add a simple back and previous button in the movie to cycle through the articles. Can anyone help me out please.

---

<div class="post-metadata">

**Author:** ![lobo](https://avatars.discourse-cdn.com/v4/letter/l/76d3ee/32.png) [@lobo](https://forum.kirupa.com/u/lobo)\
**Post date:** [May 12, 2008, 12:56pm UTC](https://forum.kirupa.com/t/next-and-previous-buttons-xml-please-help/260066/2 "2008-05-12T12:56:19Z")

</div>

the easiest way to do it would be changing your XML into  
\<?xml version=“1.0”?\>  
\<news\>  
\<story headline=‘Godzilla Attacks LA!’ descriptions=‘Equipped with a Japanese Mind-control device, the giant monster has attacked important harbours along the California coast. President to take action.’/\>  
\<story headline=‘Bigfoot Spotted at M.I.T. Dining Area’ descriptions=‘The beast was seen ordering a Snapple in the dining area on Tuesday. In a related story, Kirupa Chinnathambi, an MIT engineering student has been reported missing.’/\>  
\<story headline=‘London Angel Saves England’ descriptions=‘The “London Angel” known only as “Kit” has saved the U.K. yet again. Reports have stated that she destroyed every single Churchill bobble-head dog in the country. A great heartfilled thank you goes out to her.’ /\>  
\<story headline=‘Six-eyed Man to be Wed to an Eight-armed Woman’ descriptions=‘Uhhhmmm… No comment really… just a little creepy to see them together…’/\>  
\<story headline=“Ahmed’s Birthday Extravaganza!” descriptions=“The gifted youngster’s birthday party should be a blast. He is turning thirteen and has requested a large cake, ice cream, and a petting zoo complete with pony rides.”/\>  
\</news\>

Than in FLASH:  
newsArr = this.firstChild.childNodes; //array with 5 elements

//you can go through your headlines and descriptions like that  
name\_txt.text = newsArr\*.attributes.headline;  
comment\_txt.text = newsArr\*.attributes.descriptions;
