Series of Videos triggered by time based clicks

edited November 2017 in Library Questions

Im trying to have a code where the user clicks and the video plays; then after the video is done, the user clicks again and so on and so on. My problem is how do I do this? I have the videos but they play on top of each other and the first video never goes away. Heres the code

PImage img1;

//movie var, name after actual movie! Movie wtch1; Movie wtch2; Movie wtch3; Movie wtch4; Movie wtch5;

//The var to control what movie plays next(hopefull)---------------------------------Movie var float mvar = 1;

void setup () { size (1152, 864);

//starting image img1 = loadImage("Send.png");

//video stuff-----------------------------------------------------------------setup video wtch1 = new Movie(this, "wtch1.mov"); wtch2 = new Movie(this, "wtch2.mov"); wtch3 = new Movie(this, "wtch3.mov"); wtch4 = new Movie(this, "wtch4.mov"); wtch5 = new Movie(this, "wtch5.mov"); //

// }

void draw () { background(0); //-----------------------------------------------------------------------Starting image tint(255, 255); image(img1, 0, 0, width, height);

image(wtch1, 0, 0, width, height);//////-------------------------------------wtch1 AND if AND mvar if(mousePressed){ wtch1.play();

if(mousePressed && mvar == 2){ image(wtch2, 0, 0, width, height); wtch2.play(); mvar = 3; }

}

void movieEvent (Movie m) { //---------------------------------------------------Movie m| m.read m.read(); }

Tagged:
Sign In or Register to comment.