# AS3 and XML, HELP!

**URL:** https://forum.kirupa.com/t/as3-and-xml-help/327796
**Category:** flash
**Created:** [March 29, 2012, 6:47am UTC](https://forum.kirupa.com/t/as3-and-xml-help/327796 "2012-03-29T06:47:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![AS3Beginner](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@AS3Beginner](https://forum.kirupa.com/u/AS3Beginner)
#### Post date: [March 29, 2012, 6:47am UTC](https://forum.kirupa.com/t/as3-and-xml-help/327796/1 "2012-03-29T06:47:08Z")

</div>

Hi  
I have no idea where to post this, so pls forgive me if im in the wrong place, but I have an Assessment due tomorrow, I’m only 4 weeks knew to AS3 and Flash, and confused as, so pls forgive me if i also look silly asking this question.

The issue is loading data from an XML file and having it present in a Flash website. Its a ‘book review’ thing (i’ve altered the XML and AS3 for posting here so please bare that in mind), so the XML looks a little like this:

[COLOR=#800080]\<books\>  
\<book\>  
\<bookName\>The Monster\</bookName\>  
\<genres\>  
\<genre\>thriller\</genre\>  
\<genre\>crime\</genre\>  
\<genre\>comedy\</genre\>  
\</genres\>  
\<description\>about The Monster book.\</description\>  
\<image\>mummies.jpg\</image\>  
\<reviews\>  
\<review\>  
\<date\>16/07/2011\</date\>  
\<name\>unnamed\</name\>  
\<info\>  
\<rating\>5\</rating\>  
\<why\>blah blah\</why\>  
\<theGood\>it was good…\</theGood\>  
\<the Bad\>it was bad…\</theBad\>  
\</info\>  
\</review\>  
\</reviews\>  
\</book\>  
\<books\>[/COLOR]

but each Book has multiple reviews, i’ve just shown you one. Anyway, i need to present this information in 3 dynamic text fields when a book is selected in my ComboBox… after a lot of trouble i got the basics of it. So in the Genre box the genres will display, and in the Description box the description will display, and in the Review box i can get all the information, but only with all the tags. I need it to display without any tags, it would be wonderful if i could figure out how i could put date, name etc in front of that information as well, but I cant even begin to figure that one out. For the life of me i cannot figure it out. below is the code I have so far:

[COLOR=#a9a9a9]//Load XML[/COLOR][COLOR=#800080]  
var booksXML:XML = new XML();  
var loader:URLLoader = new URLLoader();  
var request:URLRequest = new URLRequest(“gigGuide.xml”);  
loader.addEventListener(Event.COMPLETE,loaderOnComplete);  
loader.load(request);

function loaderOnComplete(event:Event):void  
{  
booksXML = new XML(event.target.data);  
var books:Array = new Array({label:“Select a Book”});  
for each (var book:XML in booksXML.band)  
books.push({label:book.bookName.toString(), data:book.description.toXMLString(),  
infoLocal:book.genres.genre.toString(), infoDate:book.reviews.review.toString(),  
infoImage:book.image});

bandCB.dataProvider = new DataProvider(bands);  
}

[/COLOR][COLOR=#a9a9a9]//ComboBox changeable[/COLOR][COLOR=#800080]  
bookCB.addEventListener(Event.CHANGE, changeHandler2);  
function changeHandler2(event:Event):void  
{  
genre\_txt.text = ComboBox(event.target).selectedItem.infoLocal;  
description\_txt.text = ComboBox(event.target).selectedItem.data;  
reviews\_txt.text = ComboBox(event.target).selectedItem.infoDate;  
empty\_mc.tex = ComboBox(event.target).selectedItem.infoImage; [/COLOR][COLOR=#a9a9a9]//doesn’t work[/COLOR][COLOR=#800080]  
}[/COLOR]

any help would be greatly appreciated, and the image doesn’t work, i’ve already faced facts that im not going to get that one to work ☹  
Thank you in advance
