This site requires JavaScript, please enable it in your browser!
Greenfoot back
Gio
Gio wrote ...

2013/1/21

Trying to let a movie play in Greenfoot

Gio Gio

2013/1/21

#
This is what I came up with:
    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" );
    }
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?
danpost danpost

2013/1/22

#
Just to let you know, I got your message in my Private Messaging scenario and have responded.
Gio Gio

2013/1/23

#
Thank you for replying but that still doesn't help the fact that the java application isn't working once extracted to a JAR file. The video is playing for like 50 frames untill it eventually stops. When I run the SAME program in greenfoot, it works perfectly fine and there's no problems about it. Can someone please help me?
danpost danpost

2013/1/23

#
You might want to have one of the Greenfoot team members look at it. Or, you could upload it on the site, publishing the source code, so we could see what is going on.
You need to login to post a reply.