Hi everyone,
I'm trying to make a video player, which uses .jpg images.
I made it work, but it lagged hardly, cause it had to load and scale ~20images a second.
Now i want to use an array to load and scale them before playing the video itself.
Here is my code for the video object:
(this editor doesnt show up stuff in square clips, so i wrote the array clips round here.)
public class video extends Actor
{
int frame = 0;
GreenfootImage() frameShowed;
String name ="video (";
String brak = ")";
boolean stop = false;
public video()
{
frameShowed = new GreenfootImage(640);
for(int i = 0; i < 640; i++) //640 = total number of frames
{
frameShowed(i).setImage(name+frame+brak+".jpg");
getImage().scale(600,400);
}
}
public void act()
{
if(!stop)
try
{
frame ++;
setImage(frameShowed);
}
catch (java.lang.IllegalArgumentException iae)
{
stop = true;
myWorld.finished();
}
if("space".equals(Greenfoot.getKey()))
{
if(!stop){
stop = true;
myWorld.finished();
}
else
{
stop=false;
myWorld.unfinished();
}
}
}
}
the error shows up in the underlined border line.
Has anyone an idea how to solve this?


