You basically need to keep a count and use that as your stopping control. In the first frame you need something to assign the value, but you don't want to reassign it a starting value, so you could use....

var count;

if(count == undefined){ count = 0;} else { count++;}

Then, in the frame where you want to stop after one loop is completed you could have...