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.
IndexProgramming Questions & HelpSyntax Questions › Help With A Video Array
Page Index Toggle Pages: 1
Help With A Video Array (Read 940 times)
Help With A Video Array
May 7th, 2010, 8:44pm
 
Hello all,

I'm trying to make an array of movies so I can loop one segment after another and have easy access to trigger other events when there is a change.  I'm having some trouble figuring it out though.

Would I make a movie array like?:

Movie[] myMovie = { "movie1.mov", "movie2.mov", etc. }

If so, then how would I call it to be played?

If I do it the long way and establish each movie like:

Movie myMovie1;
Movie myMovie2;

myMovie1 = new Movie(this, "movie1.mov")
myMovie2 = new Movie(this, "movie2.mov")

How would I then make it into an array for easy access and looping capabilities?

I could be going about this all wrong, but its just not clicking for me.

I appreciate your help, thanks.
Re: Help With A Video Array
Reply #1 - May 8th, 2010, 12:11am
 
The first example was wrong because you try to put strings in a Movie type.
The correct syntax should be:
Code:
String[] movieNames = { "movie1.mov", "movie2.mov", etc. };
Movie[] movies;
// and in setup():
movies = new Movie[moviesNames.length];
for (int i = 0; i < moviesNames.length; i++) {
movies[i] = new Movie(this, movieNames[i]);
}

Beware of memory usage!
Page Index Toggle Pages: 1