Frame number as var?

Is there a way to get Flash to know what frame it’s on and pass that as a variable? I can’t use counters because I’m using a random frame function.

It’d make a lot of work easier!