Whats wrong with this function?

ActionScript Code:
[FONT=Courier New][LEFT]</p>
<p>function boatdragCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> i++</p>
<p> [COLOR=#0000ff]_root[/COLOR][COLOR=#000000][[/COLOR]båter[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000ff]onPress[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> pressed = true</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR]i > båtNR[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR] i = [COLOR=#000080]1[/COLOR] [COLOR=#000000]}[/COLOR]</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>
[/LEFT]
[/FONT]

båter = an array with movieclip names
båtNR = length of båter-array
i = counter
problem = when i click one of the movieclips in the array, the counter continiues, and that function is only run when pressed == false