LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
  #1  
Old 03-15-2005, 04:57 PM
kirk.netiq kirk.netiq is offline
Registered User
 
Join Date: Feb 2004
Posts: 121
Rep Power: 10
kirk.netiq is on a distinguished road
Correct and inncorrect sounds for a drag and drop

I want to have 2 sounds for a drag and drop quiz...an Applause sound if the drag and drop is correct and a Buzzer sound if it is not.

I am using this code in the main frame:

stop();
correctSound = new Sound();
correctSound.attachSound("Applause");

incorrectSound = new Sound();
incorrectSound.attachSound("Buzzer");

allCorrect =0;
// check if all answers
// are correct
_root.onEnterFrame= function(){
if(_root.allCorrect==17){
_root.endComment = "All Correct!";
correctSound.start();

}
}

next_btn.onRelease = function(){
gotoAndPlay("Quiz Intro");
;
}

prev_btn.onRelease = function(){
gotoAndPlay("Fastfood_Example");
;
}


And this code on the object being dragged:



on (press) {
x = this._x;
y = this._y;
startDrag(this);
_root.answer1 = "";
}
on (release) {
stopDrag();
if (this.hitTest(_root.lev1)) {//Change is here..
this._x = _root.lev1._x +92;
this._y = _root.lev1._y -5;
_root.answer1 = "That is correct!";
correctSound.start();
_root.allCorrect += 1;
this.enabled = false;
} else {
this._x = x;
this._y = y;
_root.answer1 = "Sorry that is incorrect, please try again.";
incorrectSound.start();
}
}


I can get the Applause sound to work, but not the Buzzer....can anyone tell me why?


Thank you.
  #2  
Old 03-15-2005, 10:45 PM
kirk.netiq kirk.netiq is offline
Registered User
 
Join Date: Feb 2004
Posts: 121
Rep Power: 10
kirk.netiq is on a distinguished road
Found the answer to sound and drag and drop

Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump




All times are GMT. The time now is 02:06 AM.