asylum24
December 3rd, 2004, 11:15 AM
well here is my code that I have
shuffle=Math.ceil(Math.random()*2)
shuffle2=Math.ceil(Math.random()*4)
if(shuffle==1){
shuffle="hawaii";
}
if(shuffle==2){
shuffle="ua";
}
gallery_stage.loadMovie("pictures/" + shuffle + shuffle2 +".jpg");
trace(shuffle + shuffle2);
that works all fine and dandy except that i have these pictures and there are 4 hawaii pictures and only 2 ua pictures. and it loads everything correectly but whenever shuffle = something more than 2 and shuffle = 2 (like if shuffle =2 and shuffle2 = 4, it owuld load ua4.jpg, which doesnt exist) so how can I check to see if it is there and if its not, redo shuffle2?
anyhelp would be appreciated.
shuffle=Math.ceil(Math.random()*2)
shuffle2=Math.ceil(Math.random()*4)
if(shuffle==1){
shuffle="hawaii";
}
if(shuffle==2){
shuffle="ua";
}
gallery_stage.loadMovie("pictures/" + shuffle + shuffle2 +".jpg");
trace(shuffle + shuffle2);
that works all fine and dandy except that i have these pictures and there are 4 hawaii pictures and only 2 ua pictures. and it loads everything correectly but whenever shuffle = something more than 2 and shuffle = 2 (like if shuffle =2 and shuffle2 = 4, it owuld load ua4.jpg, which doesnt exist) so how can I check to see if it is there and if its not, redo shuffle2?
anyhelp would be appreciated.