Help with drag n drop

I have this drag n drop that is refusing to work right. It does drag and drop, but doesn’t execute what I’m telling it to do when the submit btn is clicked.

I need it to either say “Congrats”, or say “try again and reset” or say “Sorry”.

I’m attaching the file stripped from graphics if anyone can help me…Please do!!!

Thanks

[AS]else if (firstTry) {
for (var i =1;i<=itemcount;i++) {
var obj = eval(‘item’+i);
obj._x = obj.start_x;
obj._y = obj.start_y;
}
feedbackText = tryagainFeedback;
firstTry = false;
}[/AS]
in the function checkAnswers() make sure the variable in the for loop has no capital letter in it. you a had written for (var i =1;i<=itemCount;i++) {

Thank you! I fixed that but for some reason it’s still giving me the spinning ball, i.e. an abort script mesg.

I’m doomed!

I’ve tried everything and the script abort msg doesn’t go away…:frowning:

The spinning ball went away. Now I just have to make the rest button to work…If you have any ideas, please let me know.

You helped me tremendously!!::thumb2:

I have this to initialize my clips:

function initializeItem(obj) {
    obj.startx = obj._x;
    obj.starty = obj._y;
    obj.returnFlag = false;    
}

but If a code a button to reset the clips using:

resetBTN.onRelease = function{
obj.startx = obj._x;
    obj.starty = obj._y;
}

it doesn’t put them back where they were before they were dragged and dropped to the target clips.

Everything else is working fine, but I tried different combinations to reset the clips and nothing happens.

Any lights?? The file is still the one in the original post, with the correction marked by Macaroni ( thanks again!!)

Brisa

I haven’t looked at your file but if you want your obj mc to go back to it’s initial _x and _y you have to do


resetBTN.onRelease = function{
obj._x = obj.startx;
obj._y = obj.starty;
}

I tried that too and it didn’t work.

Still in search for help.

Thank you!!!

Bri

ok first ull need to make a loop and to make sure u return all the boxes return.
and then reset all the variables u have used. so…

[AS]resetBTN.onRelease = function(){
for (var i=1;i<=itemcount;i++) {
var obj = eval(‘item’+i);
var tarObj = eval(‘targetClip’+i);
tarObj.full = false;
obj._x = obj.startx ;
obj._y = obj.starty;

}
resetClip = false

}[/AS]
i think that should work.

just had another look…and i ull need to change this “else if” statement.

[AS]
else if (firstTry) {
for (var i =1;i<=itemcount;i++) {
var obj = eval(‘item’+i);
var tarObj = eval(‘targetClip’+i);
tarObj.full = false;
obj._x = obj.startx ;
obj._y = obj.starty;
}
feedbackText = tryagainFeedback;
firstTry = false;
}
[/AS]

onegaishimasu.

Arigato
Domo arigato
Arigato gozaimasu
Arigato gozaima****a
Dan san
Ookini
Ookini arigatou
Kora doshi
Ohkini
Ookini
Oshoshina
Nihwee-deebiru

Obrigada
Thank you
Gracias
Merci
Danke

hmm…I hope I got one of them right!!:))(would you please let me know?)

Your first answer was what I was looking for and there’s not so many ways to thank someone that help me SO MUCH!!

Have a great day!! And thank you, again:))

LOL your welcome
dou itashima****e!

onegaishimasu=please
Arigato
Domo arigato
Arigato gozaimasu
are all fine

Ookini is how people say thank you in and around Kyoto!

:wink:

edit:: it wont let me type SHI*T as part of a word??

shit happens…hehehe…

Thanks for the time, answers and Japanese lessons too…hehehehehhe

Brisa