a simple video program problem help
Can someone put me out of my pain and tell me why I get an error when I remove
void mousePressed()........see at bottom of code
I get this error.......
java.lang.nullPointerException
I am not interested in loosing the logic to produce the intention of the program but to understanding why the error because removing the void mousepressed() should not cause a problem but it does.
I am coming from a basic programing background.
Thanks for your help
Franklin
Trinidad, West Indies
import processing.video.*;
Capture myCapture;
void setup()
{
size(200, 200);
// The name of the capture device is dependent those
// plugged into the computer. To get a list of the
// choices, uncomment the following line
println(Capture.list());
// And to specify the camera, replace "Camera Name"
// in the next line with one from Capture.list()
// myCapture = new Capture(this, width, height, "Camera Name", 30);
// This code will try to use the last device used
// by a QuickTime program
myCapture = new Capture(this, width, height, 30);
}
void captureEvent(Capture myCapture) {
myCapture.read();
}
void draw() {
image(myCapture, 0, 0);
}
void mousePressed() {
myCapture.stop();
}