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:
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:
<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!