Hello,
Firstly, I know that the eval(); method is old (depreciated), but I have
come to appreciate it. And I am wanting to work it in a for loop generating
and array. Here is the set up. array of strings
stringArray = new Array(string1,string2,etc);
for(j=0;jstringArrayTotal;j+=2){
month = eval(months[j+1]);
trace(month); //traces undefined;
Were is month defined? I didn't see it declared anywhere in your code
until you tried to eval() it. And why do you think eval() is useful
over [] in this case?
Jason Merrill
Bank of America
GTO Learning
In your example code, 'month' IS undefined. Array first element is [0] and
as your trace says trace(stringArray[j+1]);, that's exactly what you'll
get the first time through. Also, the for next loop won't increment the j
variable until the loop is completed. Let me know if I have misenterpreted
3 matches
Mail list logo