We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi i want to display few instances of the same movie on the screen with for loop. but don't know how to start each one of them from different position. can anyone here please help me with that?
import processing.video.*;
Movie m;
void setup()
{
size( 640, 480 );
m = new Movie( this, "missile.mp4" );
m.loop();
m.volume(0);
}
void draw()
{
background( 0 );
for (int i=0; i<6; i++) {
image( m, i*100, 0, 100, 100 );
}
}
void movieEvent( Movie m )
{
m.read();
}
Answers
Use the jump() function.
myMovie.jump(random(myMovie.duration()));
thank you, but how exactly? if i put m.jump(random(m.duration())); into setup all instances start from same random point
if inside draw it jumps around all the time m.jump(random(m.duration()));
BUT i just want to specify different starting points and then loop movie as usual like with with m.loop();
Just put jump(where you want it to go to) than really that's it's take a look at this for more info.
http://processing.org/reference/libraries/video/Movie_jump_.html
Random is just parts of the example.
i don't get how to keep on looping after jump. it just jumps to specified frame and stays still. how to specify start points for several instances of the movie and keep on looping?
Try putting m.loop after line 21.
tried this already, it doesn't move forward
Well I don't know what else I can do. I haven't used jump before. I learned about it the same day you asked it. Possibly m.continue? Could that work? In the line after 21?