actionscript 3 - AS3 - getting variable named in order within a function -
i sorry if beginner's question.
i made arrays named map01, map02
, on... can see, i'm making tile-based flash here. , need make function when input number like: createmap(1);
variable map01
, use information.
can like: var temp:array = array(["map" + valueinput]);
??
please tell me if need more.
first, instead of having variables indices in names, should create array of them. here, array of arrays.
so have call var temp:array = maps[valueinput] array;
.
if don't want , stick n variables, can write
var index:string = valueinput.tostring(); if (index.length == 1) index = "0" + index; //have index on 2 digits "01", "02" var temp:array = this["map" + index];
note work 99 first variables (oh god...)
Comments
Post a Comment