The
saveFrame() doesn't look like "saveFrame(pixels, width, height)", and will only serve to save a single image of the current display; it is not concerned with creating a "movie" file.
It wasn't obvious from looking at your code why an ArrayIndexOutOfBoundsException would occur (assuming you are referring to the code posted, and not some other code).
I found the culprit: the
exit() documentation states:
Quote:Rather than terminating immediately, exit() will cause the sketch to exit after draw() has completed (or after setup() completes if called during the setup() method).
So, your program continues on after your call to exit for one last pass through the draw() method! To bail out of draw(), you can stick in a "return;" after the exit().
Also, there is no reason to load all of the still images in at the start of the program. You only need to load (and draw) one image then call mm.addFrame() for that frame.
Code:// ** UNTESTED **
void draw()
{
// 6-digit number with (up to 5) leading zeros in filename
String fileName = "jellotail-" + nf(frameCount, 6) + ".tga";
println("Loading: " + fileName);
PImage still = loadImage(fileName);
if (still == null)
{
println("Load fail: " + fileName);
exit();
return;
}
image(still, 0, 0, width, height); // stretch to fit
mm.addFrame();
}
void exit()
{
if (mm != null) mm.finish();
super.exit();
}
-spxl