Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"undefined" error 1

Status
Not open for further replies.

gr8graphix

Technical User
May 10, 2007
3
US
Here is the piece of my code:

if (this["projectName"+three] != "") {
_global.projectFile3 = this["projectFile"+three];
heading3_txt.htmlText = this["projectName"+three];
content3_txt.htmlText = this["description"+three];
if (this["thumbnail"+three] != "") {
picHolder3_mc.loadMovie("images/"+this["thumbnail"+three]);
}
} else if (this["projectName"+three] == "") {
content3_txt.htmlText = "";
heading3_txt.htmlText = "";
}

It is for a portfolio thingie i am working on. My script pulls the data from the db three at a time and displays it. the problem is on the last "else if" statment. If there is only 2 items left to display, the third listing is suppose to put in blanks, but instead it places "undefined" in both instances. Any ideas? thanks...
 
else if (this["projectName"+three] == undefined) {
content3_txt.htmlText = "";
heading3_txt.htmlText = "";
}
 
thanks bill, but I had actually already tried that... and tried

+three] = undefined)

but that didn't work either.
 
tried to tidy up the logic a bit

if (this["projectName"+three] != undefined)
{
_global.projectFile3 = this["projectFile"+three];
heading3_txt.htmlText = this["projectName"+three];
content3_txt.htmlText = this["description"+three];
if (this["thumbnail"+three] != "")
picHolder3_mc.loadMovie("images/"+this["thumbnail"+three]);
} else
{
content3_txt.htmlText = "";
heading3_txt.htmlText = "";
}

if that dont solve it then i suspect the problem lies elsewhere in which case post more code

 
Bill, you are a f'n genius! I was thinking too that the logic was off and there was a better way but had no idea how to go about it. Do you do freelance work? I can use a f'n genius...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top