One way would be to save your users input together with the frame index as a demofile if your game mechanics are deterministic. This way, you could let the game 'play itself' by reading the input form a file (which would be quite small compared to a full screen video with audio track) Thats the way DooM 1+2 and Quake 1 stored there Demos
Otherwise, i would look for 'screen scraping on iphone' on google.
Do they provide realtime video file generation on the IPhone? is it powerfull enough for this?
Another way would be to dump copies of your framebuffer to a file for each frame (or for 25 per second) and encode these to a video file afterwards. You will have to capture your sound to a file manually too, probaly strwaming it to flash while you are playing.
If these approaches are feasible on an iPhone, i don't know, but that's how I would try to implement such a thing on a PC.