this is the code i'm using.. now, im not a pro.. (hence why i ask u folk) im just fooling around in flash to become a pro sometime in the future, but im having trouble getting flash to compose an array (or variable) name from a string. I hope u can help..
Elf = new Array (1,5,5,5,1,1,20);
Dwarf = new Array (5,20,10,5,1,10,10);
battle = new Array()
for(i=1; i<=7; i++){
battle = battle.concat("Elf"
;
}
// trace(battle.length);
for(i=1; i<=5; i++){
battle = battle.concat("Dwarf"
;
}
// trace(battle.length);
for(i=1; i<=6; i++){
battle = battle.concat("Elf"
;
}
// trace(battle.length);
trace(Elf);
trace(Dwarf);
trace(battle);
battlevar=0;
creaturevar=0;
trace(battle[0])
for(i=0; i<=battle.length; i++){
for(j=0; j<=battle[6]; j++){
creature"creaturevar" = new Array();
creature"creaturevar" = creature"creaturevar".push(battle[battlevar]);
trace(creature"creaturevar"
;
creaturevar++;
}
battlevar++;
}
stop ();
as i said, im no pro, so it could be full of other mistakes, but the string-to-(part of an)-array thingie is where im going wrong atm.. my experience is, if it doesnt allready work in fhe first place, there's got to be a way around it, but im not seeing it atm :-thx in advance for any help..
Elf = new Array (1,5,5,5,1,1,20);
Dwarf = new Array (5,20,10,5,1,10,10);
battle = new Array()
for(i=1; i<=7; i++){
battle = battle.concat("Elf"
}
// trace(battle.length);
for(i=1; i<=5; i++){
battle = battle.concat("Dwarf"
}
// trace(battle.length);
for(i=1; i<=6; i++){
battle = battle.concat("Elf"
}
// trace(battle.length);
trace(Elf);
trace(Dwarf);
trace(battle);
battlevar=0;
creaturevar=0;
trace(battle[0])
for(i=0; i<=battle.length; i++){
for(j=0; j<=battle[6]; j++){
creature"creaturevar" = new Array();
creature"creaturevar" = creature"creaturevar".push(battle[battlevar]);
trace(creature"creaturevar"
creaturevar++;
}
battlevar++;
}
stop ();
as i said, im no pro, so it could be full of other mistakes, but the string-to-(part of an)-array thingie is where im going wrong atm.. my experience is, if it doesnt allready work in fhe first place, there's got to be a way around it, but im not seeing it atm :-thx in advance for any help..