# Help Using XML in Flash 8

**URL:** <https://forum.kirupa.com/t/help-using-xml-in-flash-8/207010>\
**Category:** flash\
**Created:** [November 14, 2006, 12:52am UTC](https://forum.kirupa.com/t/help-using-xml-in-flash-8/207010 "2006-11-14T00:52:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rorymon](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@Rorymon](https://forum.kirupa.com/u/Rorymon)\
**Post date:** [November 14, 2006, 12:52am UTC](https://forum.kirupa.com/t/help-using-xml-in-flash-8/207010/1 "2006-11-14T00:52:38Z")

</div>

Hey Guy, this is my first post on this forum. My friend and I decided to try and teach ourselves Flash recently and have hit a bit of a road block, we want to be able to search using a text field in Flash that would search through an XML file and display all the corresponding child Nodes. Heres what I’ve got but it ain’t workin! :

Heres My XML: (For now just want to be able to search by course code)

> \<course\>  
> \<course\_code code= “DGA001”\>  
> \<course\_name\>Course Name: Physics\</course\_name\>  
> \<pts\_rqd\>Points Required: 435\</pts\_rqd\>  
> \<duration\>Duration: 4 Years\</duration\>  
> \</course\_code\>  
> \<dga002\>  
> \<course\_name\>Course Name: Civil Engineering\</course\_name\>  
> \<pts\_rqd\>Points Required: 460\</pts\_rqd\>  
> \<duration\>Duration: 4 Years\</duration\>  
> \<course\_code\>Course Code: dga002\</course\_code\>  
> \</dga002\>  
> \<dga003\>  
> \<course\_name\>Course Name: Business Computing\</course\_name\>  
> \<pts\_rqd\>Points Required: 360\</pts\_rqd\>  
> \<duration\>Duration: 3 Years\</duration\>  
> \<course\_code\>Course Code: dga003\</course\_code\>  
> \</dga003\>  
> \</course\>]

Heres my Action Script:

> 

function processSearch(){  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“course.xml”);  
var Result;  
Result:String=(this.firstChild.attributes.code);  
if (Result=Search){  
var Result2;  
Result2:String=(firstChild.ChildNode[0].ChildNode[0].nodeValue)  
Output=Result2;  
}  
else  
{  
Output=“It Didn’t Work!”  
};  
}

All help and Constructive criticism is welcomed!
