i have an array (this is just a test)
and i want some code that goes through it and if it = 1 attach movie 1 or if it is 2 attach movie 2 and so on??? how is this done??Code:map = new Array();
map = [[1], [2], [3]];
Printable View
i have an array (this is just a test)
and i want some code that goes through it and if it = 1 attach movie 1 or if it is 2 attach movie 2 and so on??? how is this done??Code:map = new Array();
map = [[1], [2], [3]];
Try this one:
or you can use other loops...like while() or do{...}while()Code:
for (var k=0;k<=map.length;k++){
if (map[k]==1){
attachMovie(movie1,new_movie1_name,depth); // movie1
} else if (map[k]==2){
attachMovie(movie2,new_movie2_name,depth); // movie2
} else if (map[k]==3){
attachMovie(movie3,new_movie3_name,depth); // movie3
}
}
Good luck
ZeroIQ
sorry it still does not work so could you do me a fla???
to attach a clip you need to:
right click it in the library, choose "linkage" , choose to export it and type in an ID for the clip. you use that ID when you call the attcach command. if you're using the symbol name it wont work. Then like zeroiq wrote
attachMovie(ID,new_movie1_name,depth); // movie1