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.
Page Index Toggle Pages: 1
array question (Read 182 times)
array question
Nov 29th, 2008, 2:25pm
 
hi there,

I'm new to this. i hope someone could help me.

I use one variable item from an array of objects, i would like to use the other items inside the array for another function.

example:

int var = 1;
film[var].play();
film[everythinginsidearraybutvar].stop();

can you give some directions? tnx :)
Re: array question
Reply #1 - Nov 29th, 2008, 4:01pm
 
How about:

int var = 1;
film[var].play();
for(int i = 0; i < film.length; i++){
 if(i != var){
   int everythinginsidearraybutvar = i;
   film[everythinginsidearraybutvar].stop();
 }
}



this?
Page Index Toggle Pages: 1