I have some variables in the format:
var like6Y:Number = 50;
Later I am dynamically setting some:
num=6;
Then I am trying to use that num to get the variable like6Y:
like+6+Y
I know that is totally wrong but I seem to remember you could use some kind of object notation to accomplish this:
["like"+num+"Y"]
Or something along those lines. But I can’t remember how to do it.
Thanks
It can be done – just access
this["like"+num+"Y"]. Assuminglike6numis a property of the current object, otherwise just changethisto the object’s name.