What I usually do is I calculate the number of milliseconds between frames, then I can find out what frame I need to display. For instance, if I wanted to cycle an animation at 15 FPS then the number of milliseconds would be 1000/15. That would be 66.66666 mpf(milliseconds per frame). I would round it up to 67 mpf. Then I'd need to store the time the animation started. From there, just find out how much time has passed, devide by mpf, and Mod by the number of frames.
That's off the top of my head, hopefully I didn't confuse you by introducing any mistakes.
Const MPF = 67 Const NumFrames = 8 Local Frame:int Local AnimStart:Int = Millisecs() Local TimePassed:Int ...Some code goes here TimePassed:Int = Millisecs() - AnimStart Frame = (TimePassed/MPF) Mod NumFrames DrawImage(AnimatedImage,X,Y,Frame) ...Some more code
That's off the top of my head, hopefully I didn't confuse you by introducing any mistakes.