Can anyone explain OnEnterFrame?

I’m trying to understand the OnEnterFrame method: I understand that it is an event handler that can be used to run code continuously at the frame rate set in the SWF, but how do you stop the code you envoke? Any newbie tutorials for its uses?