String vFiles[] = new String[]{ "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov", "station.mov", "street.mov" }; BVideo vPlaying; void setup() { size(200, 200); background(0); vPlaying = loadVideo(vFiles[0]); vPlaying.play(); } void loop() { if(keyPressed) { if (key == DOWN) { vPlaying.stop(); String randomFile = vFiles[(int)random(vFiles.length-1)]; vPlaying = loadVideo(randomFile); vPlaying.play(); } } image(vPlaying, 0, 0); }