This content has been marked as final. Show 8 replies
you must store the value of i associated with each array element. try:
Is this Flash 4? Because in Flash 5 and later, eval() should not appear on the left side of an assignment. So it should rather be
Seems strange that that would cause your problem, but you'll never know....
Oops, I see kglad has answered this at the same time, and with more insight.
kglad, are you're saying that the myArray parameter of myFunction doesn't get referenced until the onPress function executes? That's why "i" is undefined at that time?
There are 2 methods to do it, see the attached code.
It is Flash8
eval still works on the left side of an assignment.
Do you mean that instad of eval() I better be using this?
"Wolf van Ween" <email@example.com> wrote in message
> Is this Flash 4? Because in Flash 5 and later, eval() should not appear on
> left side of an assignment. So it should rather be
> Seems strange that that would cause your problem, but you'll never
Definitely, aa. Use this
you're welcome. and yes, i'd recommend using bracket notation in this situation.
and yes, the main issue is that i is not a persistant value and changes with each for-loop increment and you need to allow some way for your ith movieclip to know it's the ith movieclip. storing the value of i in ivar attached to the movieclip does just that.