Use javascript to check the current frame

Hi all. I need to use javascript to check the current frame of a movie that is playing in a loop. The movie has a stop action on it and I can’t add any more code to it than that. Is there a way to have javascript check the current frame every couple seconds? My problem is actually a little more complicated than I am explaining but that is the gist of it. Thanks.