Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : quick! help setting up a video array?

$
0
0
weird. it is highlighting void mouseReleased and saying void is an unexpected token.
do i have something in the wrong place?

 import processing.video.*;

    int maxMovies= 42;
    int rand=int(random(maxMovies));
   
    Movie[] myMovies=new Movie[maxMovies] ;
   
    ArrayList<PVector> moviePos = new ArrayList<PVector>();
    ArrayList<Movie> moviesPlaying = new ArrayList<Movie>();
   
 


    Movie firstclipMovie;
    void setup() {
      size (1400, 800);
      frameRate (60);
      //background(0);
      firstclipMovie = new Movie(this, "compound9.mov");
      firstClipMovie.loop();

      for (int i = 0; i < myMovies.length; i ++ ) {
        myMovies[i] = new Movie(this,i+1+ ".mov");
     
     
    
     
      moviesPlaying.add(firstClipMovie);
      moviePos.add(newPVector(0,0));
     
      background(0);
    }
   

   

  void mouseReleased(){   //this is where there's an error
      rand = int(random(maxMovies));
      moviePos.add(new PVector(mouseX, mouseY));
    
      moviesPlaying.add(myMovies[rand]);
      moviesPlaying.get(moviesPlaying.size()-1).loop();
  }

    void draw() {
   
      background(0);
      tint(255, 155);
    
     
     
    
        for (int i = 0; i< moviesPlaying.size(); i++ ) {
        Movie m=moviesPlaying.get(i);
        float x=moviePos.get(i).x;
        float y=moviePos.get(i).y;
       
       
          if (m.available())
          m.read();
         
          image(m,x,y);
        }
       
        frame.setTitle("fps"+frameRate);
      }



Viewing all articles
Browse latest Browse all 1768

Trending Articles