# Detecting a Null Event in XML

**URL:** <https://forum.kirupa.com/t/detecting-a-null-event-in-xml/206507>\
**Category:** flash\
**Created:** [November 8, 2006, 10:20pm UTC](https://forum.kirupa.com/t/detecting-a-null-event-in-xml/206507 "2006-11-08T22:20:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![misterpatrick](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@misterpatrick](https://forum.kirupa.com/u/misterpatrick)\
**Post date:** [November 8, 2006, 10:20pm UTC](https://forum.kirupa.com/t/detecting-a-null-event-in-xml/206507/1 "2006-11-08T22:20:30Z")

</div>

Hello all,

I am using a variation on the resizing gallery. Great code and I’m sure many of you are familiar with it.

Everything is working great but I do have a question. Most of my XML contains a comment for the corresponding image. When I don’t have a comment (ie null), I’d like to have the text line not display anything. I’ve had some problems figuring out the best way to do this. Here’s my XML code:

```auto

var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
    if (success) {
        xmlNode = this.firstChild;
        total = xmlNode.childNodes.length;
        var gallery = this.firstChild;
        for (var i = 0; i<gallery.childNodes.length; i++) {
           tArray.push(gallery.childNodes*.childNodes[3].firstChild.nodeValue); pArray.push("photos/"+gallery.childNodes*.childNodes[0].firstChild.nodeValue);
        }

        containerMC.loadPic(0);

    } else {
        title_txt.text = "Error!";
    }
};

```

I’ve tried working with variations on picinfo.info.text = tArray[pic]; and some basic if statements, but with no luck. Any help appreciated, thanks!
