Topic: image filtering

I have it in my mind that I want to be able to sort images based on additional attributes put into the xml file along with each image.

I found a tutorial on filtering XML data ( … orial.html) and I am trying to incorporate the actionscript from there with the AS for postcard viewer.

I think I have the concept understood - I attach attributes to the items in the XML and associate those attributes with radio buttons on the stage. If the button for a certain attribute is not selected, those images will have their visibilty set to false.

Here is the code which will do the filtering based on the buttons:
//when the user clicks the sort button from the catOptions window
filterResults.onPress = function() {
    //declare empty myCats var
    var myCats = "";
    //If items are checked, add them to the myCats var
    if (workBox.selected == true) {
        myCats += "1,";
    if (familyBox.selected == true) {
        myCats += "2,";
    if (friendBox.selected == true) {
        myCats += "3,";
    //run the getMatches function on myCats
//get matching items for selected checkboxes
function getMatches(myCats) {
    for (i=0; i<numberItems; i++) {
        _root["entry_"+i]._visible = false;
    //parse the list of numbers into an array
    searchArray = myCats.split(",");
    //loop through for each number in the array
    for (i=0; i<searchArray.length-1; i++) {
        //get the current number
        currentNum = searchArray[i];
        //find the nodes that match the current number
        for (j=0; j<numberItems; j++) {
            if (gXMLRootNode.childNodes[j].attributes["category"].indexOf(currentNum) != -1) {
                //if it matches, make the corresponding thumbnail visible and set alpha to 100
                _root["entry_"+j]._visible = true;

Now, my question is fairly simple. How do I target the loaded images to a) determine if the selected attribute applies (that part I may have figured) and b) how do I target the image to set it's visibility to zero?

I am definitely in over my head here, but I really want to crack this one. I love the elegance of the postcard viewer so much and would die for this added functionality.