brainpudding
Technical User
I am working on a project where when the user mouses over a certain movie clip it play one of 3 sounds at random, there are motions that go for each sound also, my problem is that i need it to not work if there is one of those 3 sounds already playing... so you dont get it playing over itself. this is what i have so far
//clerk actions
csound0 = new Sound();
csound0.attachSound("Welcome"
;
csound1 = new Sound();
csound1.attachSound("heritage"
;
csound2 = new Sound();
csound2.attachSound("get"
;
btnclerk.onRollOver = function(){
clerkaction = Math.round(Math.random()*2);
if(clerkaction == 0){
_root.btnclerk.gotoAndStop(1);
csound0.start(0,1);
}
if(clerkaction == 1){
_root.btnclerk.gotoAndStop(1);
csound1.start(0,1);
}
if(clerkaction == 2){
csound2.start(0,1);
_root.btnclerk.gotoAndStop("point"
;
}
}
//clerk actions
csound0 = new Sound();
csound0.attachSound("Welcome"
csound1 = new Sound();
csound1.attachSound("heritage"
csound2 = new Sound();
csound2.attachSound("get"
btnclerk.onRollOver = function(){
clerkaction = Math.round(Math.random()*2);
if(clerkaction == 0){
_root.btnclerk.gotoAndStop(1);
csound0.start(0,1);
}
if(clerkaction == 1){
_root.btnclerk.gotoAndStop(1);
csound1.start(0,1);
}
if(clerkaction == 2){
csound2.start(0,1);
_root.btnclerk.gotoAndStop("point"
}
}