Percentage animation help needed

Hello, ppl!
pardon the newbie question, but how can I create a counter using actionscript? the scene is 30 frames long and it’s sopposed to get a new value with every frame. something like counter++; example: 70% should turn 71%, 72%… 100% (but not as a preloader animation)

I tried it, using the while loop like this in first frame:

while (counter < 100)
{
counter++;
}

but it only shows 100% all the time…
any ideas?
thanks in advance.