This is what I came up with:
When I compile, and let it play in greenfoot this works fine, however, when I extract the program into a .JAR file it crashes after ~50 frames and stops the program.
How do I fix this?
private final int MAXFRAMES = 1834 //amount of frames in the video
private int frame = 1;
private Decal filmpje = new Decal("menufilmpje/Frame (1).jpg");
public Filmpje()
{
super(WORLDX, WORLDY, 1);
addObject(filmpje, WORLDX / 2, WORLDY / 2);
}
private act()
{
frame++;
if (frame > MAXFRAMES)
{
System.exit(0)
}
filmpje.setImage( "menufilmpje/Frame ("+ frame +").jpg" );
}

