countit(); p=1; function countit(){ myInterval = setInterval(countout, 2000); function countout(){ clearInterval(myInterval); trace(p++); } }