here comes the pass, and the assist...
hi al,
***edit***
didn't even see that mego beat me to it
better late than never...
late last night, megolomor sent a note to suggest the final fix; he would have fixed and sent it himself, but it was late - and he knew i was still awake...
here's the fixed code - (look for these comments: "recent change next line"; those are the changes that he suggested )
Code:
button_press = function (counter) {
arrayname = "myLetters"+counter;
countervar = "c"+counter;
// /trace(newline+"***");
// trace("arrayname= "+arrayname+newline+"countervar= "+countervar+newline+countervar+"= "+_root[countervar]);
//------ next line moved "up" from below---------recent change next line
_root.framtext.dynamicTxt = _root[arrayname][_root[countervar]];
//--------added " - 1 " in next line ------------recent change next line
if (_root[countervar]<_root[arrayname].length - 1) {
trace("****");
trace("i think countervar is still less than the arrays length");
trace(arrayname+".length="+_root[arrayname].length);
trace("countervar= "+_root[countervar]);
trace("_root["+arrayname+"]["+_root[countervar]+"]="+_root[arrayname][_root[countervar]]);
//------ commented (//) dynamicTxt line to remove it ---recent change next line
//------and moved it up above "if" statement--------recent change next line
//_root.framtext.dynamicTxt = _root[arrayname][_root[countervar]];
// trace(_root[arrayname][_root[countervar]]);
_root[countervar]++;
trace("countervar has now been updated to =" + _root[countervar]+newline)
} else {
trace("i DO NOT think countervar is less than the arrays length");
_root["button"+counter].enabled = false;
_root["button"+counter]._alpha = 20;
trace("end 2");
}
};