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?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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" ); } |