I created a drag and drop game where users drop sections on a map and instantly receive feedback if they are correct or incorrect. I've got the correct feedback working correctly but I cannot figure out the incorrect part as it is below nothing happens. Any help is greatly appreciated.
function init(){
_root.slogan.text=Slogan1;
_global.answer=Answer1;
_global.counter++;
}
function checkAnswer(guess){
trace(guess+" "+_global.answer);
if (guess==_global.answer){
_root.slogan.text=eval("Slogan"+_global.counter);
_global.answer=eval("Answer"+_global.counter);
_global.counter++;
//_root.result.text="You Are Correct";
feedback("correct");
eval("_root." + guess)._alpha=70;
eval("_root." + guess).active=0;
if (_global.counter > _global.totalquestions){
_root.complete.text="Quiz Complete";
_root.slogan.text="Quiz Complete";
}
}else{
//_root.result.text="You Are Wrong";
trace("incorrect");
feedback("incorrect");
}
}
init();
function feedback (response){
_root.correct._visible=0;
_root.incorrect._visible=0;
clearInterval (_global.feedTime);
if (response=="correct")
{_root.correct._visible=1;
}else{
trace("incorrect and code is working")
_root.incorrect._visible=1;
}
_global.feedTime=setInterval (clearFeed, 1000, response);
}
function clearFeed(response){
eval("_root."+response)._visible=0;
clearInterval (_global.feedTime);
}
Upon opening your file there were errors immediately, have a look at this file to learn about drag and drop with eval() then maybe start your project again as it seems very confused
I have put this on my site for you to use and inspect, please say when/if you download it, I will remove it after one week or when you have the files. whichever is sooner.
Tha should get you well on the way to changing everything.