In the image/animation editor, the "loop" option for the animation may be set to "yes", you should check that.
In general, when you need some issue to be solved, you may want to upload a capx file and attach it to your message (you can always cut down your code if you're afraid of it being stolen).
Cheers,
nathan