Hi, I'm trying to dynamically create variables in a Flash CC, HTML5 Canvas document using createJS.

What I'm trying to do is dynamically create variables by appending a number to the end of a string. Once created I simply want to set those created variables to a numeric value and be able to check them.

So basically I'd like to have some code that generates x amount of the following:

variable_1 = 1;
variable_2 = 1;

By appending the "variable_" + 1 (using a loop or something) to get that name and then setting it equal to a value. Then I can check their values using an If/Else statement dynamically as well.

The only other thing I'm confused about is, do need to create these dynamic variables before any checking occurs? Because I'm wondering if they aren't created and an If/Else statement looks for a var before it's created, will it give back a proper result?