Hi Nguyen. you can set the frames-per-second for playback with the movie function. The function signature is something like this: movie(stack_name, number_of_times_to_repeat, frames_per_second)
When you playback with the movie function, set the frames_per_second to a small value between 1 and 8.
When I add the following to the end of your snippet, I get a pleasant animation of F:
movie(F, 1, 1)
Yes, you can display the loop number. Look up the text function and pay attention to the String property of the text object. Use it before getframe.
And yes, you can export to a .avi. You can use the VideoWriter function to create a video from the frame data in F (look at your code). Pay attention to the frame rate again. Also be sure to pass it the cdata field of each slice in F.
BTW please select this as an accepted answer if you found it useful.