Hey
Ill cut to the chase, i have an XML file that are loaded in the Flash, and one of the variables is a web address, in the XML file tagged <WEBSTIE></WEBSTIE>. When this address is not available then i want the particular button in the Movie Clip (mc_caption.b_web) to disappear.
The problem i am having is that when the webAddress variable of the function is undefined, it works, but when the variable is blank “” it does not work, the button does not disappear. is there anyone that can help?
This is the XML file.
[COLOR=Blue]<paphos>[INDENT]<NAME>Paphos</NAME>
<MAYOR>Savvas Vergas</MAYOR>
<DESCRIPTION>Paphos is a coastal city in the southwest of Cyprus and the capital of Paphos District. In Antiquity two locations were called Paphos: Old Paphos and New Paphos. The currently inhabited city is New Paphos.</DESCRIPTION>
<WEBSTIE></WEBSTIE>
<LINK>http://www.lipsum.com</LINK>[/INDENT]</paphos>[/COLOR]
This is the Actionscript code:
[COLOR=Blue]captionButton = function (webAddress) {[INDENT]trace("-±"+webAddress);
if (webAddress == undefined || webAddress == null || webAddress == “”) {[INDENT]trace(“Nothing to Display”);
mc_caption.b_web._visible = false;[/INDENT] } else {[INDENT]mc_caption.b_web._visible = true;
mc_caption.b_web.onRelease = function() {[INDENT]getURL(webAddress, “_blank”);[/INDENT] };[/INDENT]}[/INDENT]};[/COLOR]