mardi 5 janvier 2016

User-Interaction if,else statement

I am working on a game inside of Adobe Edge that will auto advance in 3s when it is not interacted with. I am having some issues with the if,else statement I have developed.

var interacted = false;
var eventTimer=window.setTimeout(function(){if(interacted) {console.log("interacted");}else{console.log("not interacted"); sym.play("TheFinalFrame");}},3000);

The error in my console is not registering the "if" and reads:

"Javascript error in event handler! Event Type = element” when interacted with and proceeds to the else statement and logs "not interacted".

Does anyone have any idea why this is happening and how to correct the issue?

Aucun commentaire:

Enregistrer un commentaire