Hi guys I have a piece of code that's not working I was hoping someone had any clue as to why, I've wasted too many hours trying to figure this out. Here's the code, explanation below. var objCP = document.Captivate; objCP.cpEISetValue("m_VarHandle.questionList", new Array(7)); objCP.cpEISetValue("m_VarHandle.questionList[0]", 1); objCP.cpEISetValue("m_VarHandle.questionList[1]", 2); objCP.cpEISetValue("m_VarHandle.questionList[2]", 1); objCP.cpEISetValue("m_VarHandle.questionList[3]", 2); objCP.cpEISetValue("m_VarHandle.questionList[4]", 1); objCP.cpEISetValue("m_VarHandle.questionList[5]", 2); var cat1Len = 0; var cat2Len = 0; for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){ var value = objCP.cpEIGetValue("m_VarHandle.questionList"); if (value == 1) {cat1Len++;} if (value) == 2) {cat2Len++;} alert(i); alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]")); alert(value); } I'm attempting to create a list using a captivate variable I've created called "questionList". I fill questionList with data and and then use that data to count, in this instance with cat1Len and cat2Len. After that I attempt to verify that the data is being returned correctly with a series of alerts. Here's the problem: alert(i) correctly reports the number my incrementer should be at. alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]")) correctly reports the data in cell [2] of questionList but... alert(value) reports undefined. How can this be? I know that I can access array elements from inside this loop and I know that I my incrementer is at the correct location so what's the deal? Thanks for any help!
... View more