hello
I have two buttons that getURL either to a PDF or link to a website, and the PDF path and link path are dynamic based on an XML file.
in some cases there isnt a PDF or link so I need to display an message. I thought this code would work but its always displaying the message, even when it has a success (has an assigned value). Also, after I push the button once, button looses its assignment to the variable, (Im checking via trace), and then is always coming up ‘undefined’
here is some code:
function DisplayInfo(){
scrollField.initScroll();
PressScroller.scroll_content.scrollField.text = this.bodytxt;
PressScroller.scroll_content.scrollField.autoSize=true;
var assignPDF = this._parent.assignPDF;
var assignLink = this._parent.assignLink;
btn_PDF.onRelease = function () {
if (assignPDF = "undefined") {
PressUndefined.gotoAndPlay(1); //this displays 'no data' message
DisplayInfo;
} else {
getURL(assignPDF,_blank);
}
}
btn_Link.onRelease = function () {
if (assignLink = "undefined") {
PressUndefined.gotoAndPlay(1);
DisplayInfo;
} else {
getURL (assignLink,_blank);
}
}
}
the release calls work when I remove the if/then statement from the code, it just gives an error when there isnt any data in the XML file.
TIA
celticvfx