Acquiring current frame value

i was wondering if anyone could help me with acquiring the current frame number of a movie.

the code i’m trying to write goes something like this:

currentframe = movie.currentframe; // here’s where the problem is
if (currentframe == 5)
{
gotoAndPlay(25);
}
else if (currentframe == 6)
{
gotoAndPlay(26);
}
else
{
gotoAndPlay(27);
}

i’ve been searching all over the net for a solution. i can’t figure out how to give “currentframe” the number value of the current frame its in.