How do i use "for"

Hi…
i’m a beginner in actionscript 3.0 and it would mean a lot to me if you could help me to progress, and give me some tips.

at school, we got this task to make: SirHj__rneKvadrMedKnapp.swf - 0.02MB

for those who don’t understand the language, the first input stands for numbers of circles, the second input is for numbers of squares, and the third one is for distance between them.

Here is what i have made so far, and as you see, it’s far from perfect. does any one have a clue, about what i’m doing wrong here?
graphics.lineStyle(1,0xC01503,1);

knapp.addEventListener(MouseEvent.CLICK, begynn);

function begynn(evt:MouseEvent) {
for (var tller:int=1;teller<=Number(input2.text);teller = teller + 1){
graphics.drawRect(300-teller* 10, 150-teller* 10, teller * 20, teller * 20);
}

for(var teller:int=1; teller <=Number(input1.text); teller = teller +1){

graphics.drawCircle(0, 0,teller * 10);
graphics.drawCircle(600, 0,teller * 10);
graphics.drawCircle(0, 300,teller * 10);
graphics.drawCircle(600, 300,teller * 10);

}

}