>> if ((myLinker1 != "") || (myLinker1 != undefined) || (myLinker1 != null)) { myHtml += "<a href=\"" + myLinker1 + "\" target=\"_blank\">" + myLinker1 + "</a><br>"; }
but then the trace of my results does not even work (it includes the records that are empty). << Shouldn´t it be if ((myLinker1 != "") && (myLinker1 != undefined) && (myLinker1 != null)) ? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dnk Sent: Tuesday, August 15, 2006 5:59 PM To: Flashcoders mailing list Subject: [Flashcoders] [:::] appending html to a var for display not working and code not runnign as expected. Ok.... so i have a recordset with links in which I am building an HTML string for display in an HTML field. Now for some reason the html traces out fine, but when assigned to an html txt field - the filed just shows as blank. Now I do realize that the "eq" in this code sample is depreciated, however that is on another thread (as the "==" gave weird results). And I do realize that my if statements are backwards as I check for equality and do nothing until the else statement, but again, I was getting weird results (I was trying to test for an empty field from a database return - through amfphp - this seemed to be the only way I could get it to work - and I hate that it is not proper code). Anyways - onto the code. function handleGetLinks(re:ResultEvent) { this._DB = re.result; // initialize the last record count this._lastRecord = (this._DB.length - 1); //for (var i = this._currentRecord; i <= this._lastRecord; i++) var myHtml:String = ""; for (var i = 0; i <= 10; i++) { var myLinker1 = this._DB.getItemAt(i).link01; var myLinker2 = this._DB.getItemAt(i).link02; var myLinker3 = this._DB.getItemAt(i).link03; var myLinker4 = this._DB.getItemAt(i).link04; var myLinker5 = this._DB.getItemAt(i).link05; if ((myLinker1 eq "") || (myLinker1 eq undefined)) { } else { myHtml += "<a href=\"" + myLinker1 + "\" target=\"_blank\">" + myLinker1 + "</a><br>"; } if ((myLinker2 eq "") || (myLinker2 eq undefined)) { } else { myHtml += "<a href=\"" + myLinker2 + "\" target=\"_blank\">" + myLinker2 + "</a><br>"; } if ((myLinker3 eq "") || (myLinker1 eq undefined)) { } else { myHtml += "<a href=\"" + myLinker3 + "\" target=\"_blank\">" + myLinker3 + "</a><br>"; } if ((myLinker4 eq "") || (myLinker1 eq undefined)) { } else { myHtml += "<a href=\"" + myLinker4 + "\" target=\"_blank\">" + myLinker4 + "</a><br>"; } if ((myLinker5 eq "") || (myLinker1 eq undefined)) { } else { myHtml += "<a href=\"" + myLinker5 + "\" target=\"_blank\">" + myLinker5 + "</a><br>"; } } if ((myHtml eq "") || (myHtml eq undefined) || (myHtml eq null)) { trace("it is empty"); } else { trace(myHtml); this._targetMc.collectiveLinks.html = true; this._targetMc.collectiveLinks.htmlText = myHtml; } this._targetMc.collectiveLinks.htmlText = myHtml; } Now to me what I "thought" should have been the proper way to test would have been: if ((myLinker1 != "") || (myLinker1 != undefined) || (myLinker1 != null)) { myHtml += "<a href=\"" + myLinker1 + "\" target=\"_blank\">" + myLinker1 + "</a><br>"; } but then the trace of my results does not even work (it includes the records that are empty). And to top it off - no matter what my text field does not have the HTML loaded into it. It seems like something like this should be so simple. d _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com