If anyone has time could you PLEASE look at the code below (I've also attached the fla file). I've made a drag and drop game which works but the incremental score won't work. I've only placed code on this draggable object. (Thought I'd try to get one working before I messed up the lot.) As you can see from the comment lines I've tried a lot of code options but none will work.
I'm a complete novice so I greatly appreciate any help given.
Thanks
PHP Code:on(press) {
startDrag(this);
//on mouse up drag object
}
on(release) {
stopDrag();
//on mouse down drop oject
if (this._droptarget == "/innerCoreTarget") {
// if the draggable oject is dropped onto the correct target
this._visible = false;
// make the draggable object disappear
_root.innerCoreCorrect._visible = true;
// make the target picture visible
mouseSound = new Sound(this);
mouseSound.attachSound("clickwav");
mouseSound.start();
//play a sound effect of the object snapping into place
_root.checkbox5.gotoAndStop(2);
// display a correct tick in the score box
//var score = 0;
//scorecounter.text = score;
//function updateScore() {
//scorecounter.text = ++score;
//}
//_root.scorecounter.text = _root.scorecounter.text + 1;
//prevScore = int(textField.text)
//newScore = prevScore + 10
//textField.text = newScore
//updateScore
// _root.scorecounter = _root.scorecounter + 1;
//scorecounter = scorecounter +1
//_root.scorecounter -= 1
//_root.score+=10
//updateScore();
}
else{
// if the draggable object is not placed on the correct target
this._x = 444;
this._y = 137;
// move the draggable object back to its pre dragged position
_root.checkbox5.gotoAndStop(1);
// don't display the correct tick
}
}




Reply With Quote