It is possible to dynamic change the name of the vars is AS3 using flash? I mean, create for example 10 vars with one root name like: myvar and then incrementing a number, like myvar0, myvar1, myvar2 and so on.
I while ago i achived this in AS2 with this code:
for (i = 0; i < 5; i++)
{
var mc = _root.attachMovie("my_square", "my_square_"+i, i);
mc._x = i * 50;
}
But now im in AS3 and the var a need to copy is this:
var caja1:HTMLTextBlock = new HTMLTextBlock();
How can in generates in a FOR, caja1, caja2, caja3 and sp.
Thanks for any help!
I think a very simple and clean way of achieving this is creating an array.
Just remember that the first entry in the array starts with 0 and not 1 (i.e. caja[0]).
Hope this helps 🙂