Arrays Menu

Hi!
I´m trying to initialize myself in Arrays stuff… and i´m having some difficulties

i would like to make a menu like the one attached, can anybody help me with it?

thnx a lot

gr:):nerd::rambo: ve

:q:

hmmmmm

how can i attach a gif image?

when you post a reply, there’s a “Attach file:” thingie at the bottom

ok… here it is…

the numbers are wrong… but i hope you understand the ideia

thnx

what’s the relation between that and an array? :slight_smile:

it´s for learning purposes :slight_smile:

This is a menu that i´m studying… and i kinda understand it

i want to create something like a table with rows and columns…

:slight_smile:

i can’t run a ‘rar’ file… erm… do you want to generate a table based on an array?

yes, that´s it, with a loadMovie action in one of those buttons

alright… great commenting :stuck_out_tongue:

you can use a multidimensional array…

i don’t quite get your code (since the portuguese naming convensions), but it would look something like this:

//colocar o mc_b e o mc_bf invisiveis, estes sao os movies que vamos utilizar para o menu
mc_b._visible = false;

//construção do array com o que deve aparecer no menu
conteudos = [["1", "2", "3", "4"],
["5", "6", "7", "8"],
["9", "10", "11", "12"]
];



//função para construir o menu
function construct() {
	for (y=0; y<=conteudos.length; y++) {
		for (x=0; x<=conteudos[y].length; x++) {
		mc_b.duplicateMovieClip("mc_b"+x+"_"+y, ++depth);
		this["mc_b"+i].txt = conteudos[y][x];
		this["mc_b"+i]._x = this["mc_b"+i]._height+20*i;
		this["mc_b"+i].numero = conteudos[y][x];
		this["mc_b"+i].state = "pai";
	}
	}
}
// funcao para fazer o botao conteudo voltar ao normal
function clearBotao (){
	for (k = 1; k<=10; ++k){
		this["mc_bf"+k].removeMovieClip();
	}
	for (t = 1; t<=conteudos.length; ++t){
		this ["mc_b"+t].gotoAndStop(1);
	}
}
// funcao q serve para carregar os swf´s externos dos pais
function showLinks_P (x, y, state) {
	conteudos = links[y][x]+".swf";
	loadMovie (aux_movie, "_root.mc_conteudo");
}
//chamar a função de construir o menu
construct();

the file i made (below) might be of some help :slight_smile:
http://www.kirupa.com/lab/animator.htm

only two squares appear… :frowning:

eek… sorry, i screwed up:

//colocar o mc_b e o mc_bf invisiveis, estes sao os movies que vamos utilizar para o menu
mc_b._visible = false;
//construção do array com o que deve aparecer no menu
conteudos = [["1", "2", "3", "4"], ["5", "6", "7", "8"], ["9", "10", "11", "12"], ["9", "10", "11", "12"]];
trace(conteudos.length)
trace(conteudos[1].length)
//função para construir o menu
function construct() {
	for (y=0; y<conteudos.length; y++) {
		for (x=0; x<conteudos[y].length; x++) {
			clip = mc_b.duplicateMovieClip("mc_b"+x+"_"+y, ++depth);
			clip.txt = conteudos[y][x];
			clip._x = this["mc_b"+i]._height+20*x;
			clip._y = this["mc_b"+i]._height+20*y;
			clip.numero = conteudos[y][x];
			clip.state = "pai";
		}
	}
}
// funcao para fazer o botao conteudo voltar ao normal
function clearBotao() {
	for (k=1; k<=10; ++k) {
		this["mc_bf"+k].removeMovieClip();
	}
	for (t=1; t<=conteudos.length; ++t) {
		this["mc_b"+t].gotoAndStop(1);
	}
}
// funcao q serve para carregar os swf´s externos dos pais
function showLinks_P(x, y, state) {
	conteudos = links[y][x]+".swf";
	loadMovie(aux_movie, "_root.mc_conteudo");
}
//chamar a função de construir o menu
construct();

allllrighttttt

thanx a lot!!!

:smiley:

you made me a happy dude!!!

:beam: