Hello all,
I'm very very new to actionscript and am trying to troubleshoot a problem with a little research, but so far I've hit a wall.
I want to detect when a value is null and cause it to do one thing, and if it is not null, to do another.
This is the original code (the url_txt.htmlText is the focus of my problem):
Code:
function clickHandler3(evt:Wall3DEvent):void{title_txt.text = " ";
desc_txt.text = " ";
url_txt.htmlText = "";
inLargeImage = false;
trace("Disabling text");
mySource = "";
myURL = "";
close_btn.visible = false;
}
wall.addEventListener(Wall3DEvent.ELEMENT_DESELECTED,clickHandler3);
function clickHandler2(evt:Wall3DEvent):void{
title_txt.text = evt.element.getUserProperty("title");
desc_txt.text = evt.element.getUserProperty("description");
url_txt.htmlText = "<a target="+'"_blank"'+" href="+"'"+"http://"+(evt.element.getUserProperty("url"))+"'"+">"+(evt.element.getUserProperty("url"))+"</a>";
inLargeImage = true;
myURL = evt.element.getUserProperty("url");
mySource = evt.element.src;
trace("Showing Large Image and text.");
wall.addEventListener(Wall3DEvent.CAMERA_MOVEMENT_COMPLETE, zoomComplete);
}
wall.addEventListener(Wall3DEvent.ELEMENT_SELECTED,clickHandler2);
This is what I tried:
Code:
function clickHandler3(evt:Wall3DEvent):void{title_txt.text = " ";
desc_txt.text = " ";
url_txt.htmlText = "";
inLargeImage = false;
trace("Disabling text");
mySource = "";
myURL = "";
close_btn.visible = false;
}
wall.addEventListener(Wall3DEvent.ELEMENT_DESELECTED,clickHandler3);
function clickHandler2(evt:Wall3DEvent):void{
title_txt.text = evt.element.getUserProperty("title");
desc_txt.text = evt.element.getUserProperty("description");if (url_text.htmlText != ""){ url_txt.htmlText = "<a target="+'"_blank"'+" href="+"'"+"http://"+(evt.element.getUserProperty("url"))+"'"+">"+"View Site"+"</a>";
} else {url_txt.htmlText = "";
}
inLargeImage = true;
myURL = evt.element.getUserProperty("url");
mySource = evt.element.src;
trace("Showing Large Image and text.");
wall.addEventListener(Wall3DEvent.CAMERA_MOVEMENT_COMPLETE, zoomComplete);
}
wall.addEventListener(Wall3DEvent.ELEMENT_SELECTED,clickHandler2);
Any suggestions?
Thanks!