drumn4life0789
07-01-2008, 04:27 AM
I have this code
enter_btn.onRelease = function () {
bracket1 = team1;
bracket2 = team2;
bracket3 = team3;
bracket4 = team4;
}
bracket1 is a dynamic text box and team1 is an input text box. When the user fills in the team text box and clicks the enter button it will fill in the bracket text box. This is very simple and it works fine. Right now I am ok with this code but I am just trying to do something on the small scale as of now, so I can learn it for my bigger project I am doing.
I would like to use a for loop because the values of the bracket and team will soon be up to 32 and it will be alot of waisted space and time to type them all out. I know I can use for loop but for some reason i just cant figure out why its not working for me.
enter_btn.onRelease = function () {
for (i=1; i<=4; i++) {
["bracket"+i] = ["team"+i];
}
}
enter_btn.onRelease = function () {
bracket1 = team1;
bracket2 = team2;
bracket3 = team3;
bracket4 = team4;
}
bracket1 is a dynamic text box and team1 is an input text box. When the user fills in the team text box and clicks the enter button it will fill in the bracket text box. This is very simple and it works fine. Right now I am ok with this code but I am just trying to do something on the small scale as of now, so I can learn it for my bigger project I am doing.
I would like to use a for loop because the values of the bracket and team will soon be up to 32 and it will be alot of waisted space and time to type them all out. I know I can use for loop but for some reason i just cant figure out why its not working for me.
enter_btn.onRelease = function () {
for (i=1; i<=4; i++) {
["bracket"+i] = ["team"+i];
}
}