For loop

as2 for loop to go through 10 moon objects inside the moons movieclip,
doesnt seem to access each moon but if i put moons.moon1.gotoAndStop(left4) outside of the loop it works fine,
can anyone see a problem with my syntax?
thanks

onEnterFrame = function(){
			
	for(var i=1; i <11; i++){
	if (moons.moon(i)._currentframe >= left4) {
   		moons.moon(i).gotoAndStop(left4);//}
	}
}