FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Back  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

movieEvent()

   
Examples  
import processing.video.*; 
Movie myMovie; 
 
void setup() { 
  size(200, 200); 
  myMovie = new Movie(this, "totoro.mov"); 
  myMovie.loop(); 
} 
 
void draw() { 
  image(myMovie, 0, 0); 
} 
 
// Called every time a new frame is available to read 
void movieEvent(Movie m) { 
  m.read(); 
} 
 


import processing.video.*; 
Movie myMovie, yourMovie; 
 
void setup() { 
  size(200, 200); 
  myMovie = new Movie(this, "totoro.mov"); 
  yourMovie = new Movie(this, "catbus.mov"); 
  myMovie.play(); 
  yourMovie.play(); 
} 
 
void draw() { 
  image(myMovie, 0, 0); 
  image(yourMovie, 100, 0);  
} 
 
void movieEvent(Movie m) { 
  if(m == myMovie) { 
    myMovie.read(); 
  } else if(m == yourMovie) { 
    yourMovie.read(); 
  } 
} 
 

Description   Called when a new movie frame is available. Use the read() method to capture this frame. If there is more than one movie in the program, movieEvent() is called each time any of the movies has a new frame available. Use an if() to determine which movie is triggering the event. See the above example for implementation details.
   
Syntax  
void movieEvent(Movie which) {
  statements
}
   
Parameters  
statements   any valid statements

which   the movie with the event

   
Usage   Web & Application
   
Related   Movie
 
 






   
 
Updated: Fri Jul 15 16:41:06 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info  
mons License -->
Creative Commons License     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   ://web.resource.org/cc/Distribution" /> -->     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   A versatile input provider, a popup window with a set of interactive