I’ve have a question about dynamically accessing arrays. I’m going to have a number of arrays, char_a, char_b, char_c, etc…
The values of these arrays will be used to load in other movie clips, x, y, scale, color, etc…
_root.char_a =[15,20,100]
I have a function to load in movie clip based on a given array, the variable I’m passing to the function is going to be a, b, c, etc… So if I pass ‘a’ to the function I want to load in the movie clip based on the values in “char_a”, [15,20,100].
function loadCharLoc(name) {
x = this[‘root.char’ + name][0];
y = this[‘root.char’ + name][1];
moviename = ‘grid_char_’+name;
_root.main_grid.attachMovie(moviename, moviename, getNextHighestDepth(), {_x:x, _y:y});
When I trace the values of x or y I get undefined. Any suggestions on whats wrong with this and how to fix it.
thanks