BooYaKaSha
Technical User
Long story short, I have this script:
for (i = 1; i <= currentType.length; i++)
// (sic)
{
this["piece" + i].onRollOver = function()
{
getDescription(i);
descriptionBar.gotoAndPlay("over"
}
// (sic)
}
The "getDescription(i)" part won't work, and I understand why, but how can I modify that to make it work. I need "i"'s value to be taken literally right then and there, not when the callback gets executed.
I've tried things like "eval(i)", "function() {return i}" and "i.toString()" to no avail.
Thanks a million for your help.
for (i = 1; i <= currentType.length; i++)
// (sic)
{
this["piece" + i].onRollOver = function()
{
getDescription(i);
descriptionBar.gotoAndPlay("over"
}
// (sic)
}
The "getDescription(i)" part won't work, and I understand why, but how can I modify that to make it work. I need "i"'s value to be taken literally right then and there, not when the callback gets executed.
I've tried things like "eval(i)", "function() {return i}" and "i.toString()" to no avail.
Thanks a million for your help.