# AS3: conditional statement to determine if an xml child is null... help!

**URL:** <https://forum.kirupa.com/t/as3-conditional-statement-to-determine-if-an-xml-child-is-null-help/290583>\
**Category:** Uncategorized\
**Created:** [June 16, 2009, 7:17pm UTC](https://forum.kirupa.com/t/as3-conditional-statement-to-determine-if-an-xml-child-is-null-help/290583 "2009-06-16T19:17:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)\
**Post date:** [June 16, 2009, 7:17pm UTC](https://forum.kirupa.com/t/as3-conditional-statement-to-determine-if-an-xml-child-is-null-help/290583/1 "2009-06-16T19:17:33Z")

</div>

With this code, I need to determine if the xml child is null and form a conditional statement upon that info. I have it very close but something is just “un-tweeked” enough that it wont work correctly. AS3 and XML provided below…

Thanks!

AS3:

```auto
var url = txtBox_mc.getTix.url;
var request:URLRequest = new URLRequest(url);
txtBox_mc.getTix.addEventListener(MouseEvent.CLICK, GetUrTix);
function updatePic(index:int):void {
    txtBox_mc.getTix.url = picList[index].url;
    if (url == null) {
        txtBox_mc.getTix.visible = false;
        trace("button null");
    } else {
        txtBox_mc.getTix.visible = true;
        trace("button there");
    }
    txtBox_mc.EventHeader.htmlText = picList[index].caption1;
    txtBox_mc.EventDate.htmlText = picList[index].caption2;
    txtBox_mc.EventPlace.htmlText = picList[index].caption3;
    trace(picList[index].url);
    trace(picList[index].caption1);
    trace(picList[index].caption2);
    trace(picList[index].caption3);
    trace(index);
}
function GetUrTix(event:MouseEvent):void {
    navigateToURL(request);
    trace("gettin some tix");
}

```

XML:

```auto
<slideshow>
    <image>
        <url>http://www.yahoo.com</url>
        <caption1>This is the show</caption1>
        <caption2>September 14-15</caption2>
        <caption3>Where Else</caption3>
    </image>
    <image>
        <caption1>What a Show</caption1>
        <caption2>August 14-15</caption2>
        <caption3>Where is It</caption3>
    </image>
    <image>
        <url>http://www.cubiccreative.com</url>
        <caption1>Jazz Hands</caption1>
        <caption2>December 14-15</caption2>
        <caption3>Tuen Left at the Sign</caption3>
    </image>
</slideshow>

```

The problem now only the " if (url == null) { " is read, thus returning those results. I believe the issue is within the definition of url " var url = txtBox\_mc.getTix.url; "…  
Any help is greatly appreciated!
