What is causing the loop?
If you click on the blue margin to the left of the line...
... you will see a red dot appear. This is a breakpoint. When you run your movie, each time the on enterFrame() handler is called, the Debugger window will open at this point. Click on the Close button to close the window. It will reopen immediately. Director has called the on enterFrame() handler again.
That's what Director does. Every time it updates the screen (which it does many times a second), it sends an #enterFrame event to all sprites, to say "I've finished updating the screen. I'll let you do some stuff now. When you've finished, I'll wait a bit until it's time to update the screen again."
Perhaps it would make more sense to change on enterFrame to on beginSprite. That will only get called once, when the playback head arrives on a frame where the sprite exists from a frame where it did not exist.
Thanks for the thorough explanation.