Here is my problem. The photography data loads from the XML file. When the user clicks the button that information is overwritten an replaced by the names of all the users in the XML file. What I want to do is when a user clicks on one of the photography buttons ie. landscape that will then only show the names of the people in the XML file with landscape in the profile in the XML.
What is the best way to go about this? Should I try to write an if statement that tells me if the child is found within the XML profile then return the name if the answer is yes? That is what I have been trying to do but not succeeding. Any feedback would be great. Thanks.
photographylist: which contains an array with the duplicates removed from the XML
var photographylist:Array = [];
xmlinfo.profile.photography.(photographylist.push(toString()));
for (var i:int =0; i<totalimage; i++){
textvar.text = photographylist[i];
background.addChild(textvar).addEventListener(MouseEvent.CLICK,loadnames);
}
var list2:Array = new Array();
xmlinfo.profile.first_name.(list2.push(toString()));
list2.sort();
trace(list2 + " array 2 list");
Here is a sample of the XML
<profile>
<first_name>ann</first_name>
<last_name> lee</last_name>
<photography>sport</photography>
<photography>landscape</photography>
<photography>still life</photography>
<image>img1.jpg</image>
<course>multimedia</course>
<email>annlee@mycit.ie</email>
</profile>