We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Separate playback of two movies (Read 424 times)
Separate playback of two movies
Dec 5th, 2009, 10:13am
 
Hi

I'm having difficulty in loading two movie files in one program.
One should loop & the other should play upon request.

The effect is to create a hairline background & upon interaction play movie. What is happening is once 'Playing' the main feature continues playing.

Is there a way to allow separate threads for two movies?

here code:

GLOBALS
Code:
Movie theMovie;
Movie theWhite;


SETUP
Code:
theMovie = new Movie(this, "themovie.3gp");
theMovie.play();

theWhite = new Movie(this, "thewhite.3gp");
theWhite.loop();


DRAW

Code:
void draw(){
background(#c0c0c0);
// image(theWhite, 0, 0);
if (arduino.digitalRead(buttonPin) == 1){
image(theMovie, 0, 0);
theMovie.loop();
//} else { image(theWhite, 0, 0);
}
//if (arduino.digitalRead(buttonPin) == 0){
// image(theWhite, 0, 0);
//}
}
Page Index Toggle Pages: 1