0
votes

I'm sure this is a very basic question, but I'm just wondering if it's possible to create shared object and name it after a string variable.

For Example:

var newvariable:Number = 0;

so.data.newvariable.toString(); = ??

Now I know that with the above example /\ there are easier ways around it, but I really need to find out alternative methods so I can actually name the shared object after the variable. Really appreciate this!

1
Dont mind the semicolon /\user1666767
variable names are irrelevant, you need a better understanding of coding and Flash coding in general. What you really care about is the value a variable point to, not the variable itself.BotMaster

1 Answers

1
votes

You can use array access brackets to create dynamic property names from variables:

var count:int = 0;
so.data["newvariable" + count] = "foo";