Althalas
03-21-2006, 07:18 PM
Right, here's the problem:
I am trying to create first an array of buttons(with pure actionscript), followed by drawing and moving each button into position according to a loop. For example, 10 buttons at coordinates (20*i,20*i) when i goes from 1 to 10.
What I have currently is the following abomination unto nature:
//Create an array and trace the label of the first one (returns undefined)
mx.accessibility.ButtonAccImpl.enableAccessibility ();
import mx.controls.Button;
var buttonArray:Array = Array();
for(i=0;i<10;i++){
buttonArray[i] = new Button("my_button"+i,10,{label:i});
}
trace(buttonArray[0].label);
If I get this fixed I guess the next step would be actually creating the set of 10 buttons. For this, I was thinking along the lines of:
//create the buttons
for(i=0;i<10;i++){
createClassObject(this,buttonArray[i]);
buttonArray[i].move(20*i,20*i)
}
There it is. Anyone?
*braces for impact*
I am trying to create first an array of buttons(with pure actionscript), followed by drawing and moving each button into position according to a loop. For example, 10 buttons at coordinates (20*i,20*i) when i goes from 1 to 10.
What I have currently is the following abomination unto nature:
//Create an array and trace the label of the first one (returns undefined)
mx.accessibility.ButtonAccImpl.enableAccessibility ();
import mx.controls.Button;
var buttonArray:Array = Array();
for(i=0;i<10;i++){
buttonArray[i] = new Button("my_button"+i,10,{label:i});
}
trace(buttonArray[0].label);
If I get this fixed I guess the next step would be actually creating the set of 10 buttons. For this, I was thinking along the lines of:
//create the buttons
for(i=0;i<10;i++){
createClassObject(this,buttonArray[i]);
buttonArray[i].move(20*i,20*i)
}
There it is. Anyone?
*braces for impact*