Spot the Difference - find errors


I'm trying to find a way to spot the errors if you click outside the differences; if you do it 5 times, game is over.

i tried this code in both the pictures, but numErrorsFound increases even if you click a difference.

can you help me with this?

thank you


Code :

if ( <
    var err = wade.getSceneObject('err ' +;
    if ( ==
       alert('you lost!');
         wade.loadScene('home.wsc', true, function()


1 Comment


That bit of code actually looks alright. I think the problem must be somewhere else, and it's a bit difficult to guess without seeing the whole thing.

However, my best guess is that the mouseDown event is being propagated to the background pictures, i.e. you get onMouseDown on the difference object, and then you also get onMouseDown on the object behind it.

To stop an event from propagating, simply return true in the event handler. In this case you probably want to return true from the difference object's onMouseDown function.

Post a reply
Add Attachment
Submit Reply
Login to Reply