I have 4 buttons on my canvas named item1, item2, item3 and item4. In the first frame i've written this code(as2):
stop();
for (n = 0; n <= 10; n++)
{
this["item" + n].onPress = function ()
{
trace('lol');
};
}
When click the one named item1, it doesn't shows lol, which is funny because if i do this:
stop();
for (n = 0; n <= 10; n++)
{
trace(n);
this["item" + n].onPress = function ()
{
trace('lol');
};
}
It outputs:
1
2
3
4
Do someone has an answer? Because to me it looks like simply a bug.