PDA

View Full Version : Drag and Drop Game


Elder
11-26-2002, 01:14 PM
I'm doing a drag and drop game. Everything is working ok, but I want after 3 attempts if you get it wrong you get right answer but only on the 4th time pressing the submit button???

Any Ideas??

Here is the code for the submit button which you can press as many times you want!!

on (press) {
// Set the answers here
var lngCount;
lngCount = 0;
// Drag 1 =
if (eval(_root.drag1._droptarget) == _root.drop6) {
lngCount = lngCount + 1;
}
// Drag 2 =
if (eval(_root.drag2._droptarget) == _root.drop1) {
lngCount = lngCount + 1;
}
// Drag 3 =
if (eval(_root.drag3._droptarget) == _root.drop3) {
lngCount = lngCount + 1;
}
// Drag 4 =
if (eval(_root.drag4._droptarget) == _root.drop5) {
lngCount = lngCount + 1;
}
// Drag 5 =
if (eval(_root.drag5._droptarget) == _root.drop4) {
lngCount = lngCount + 1;
}
// Drag 6 =
if (eval(_root.drag6._droptarget) == _root.drop2) {
lngCount = lngCount + 1;
}

if (parseInt(lngCount) == 6) {
_root.txtResult.text = "Well Done, Correct Answer!";
}
else {
_root.txtResult.text = "Sorry, Wrong Answer";
}
}