iTween - calling functions on oncomplete doesn't work if the function is declared as a variable

Hi - so I have a weird catch22 happening - I’m trying to build a game for iPhone in javascript. iPhone requires that you declare your functions as variables (I think), like this:

var myFunction = function(){ };

but in order for iTween’s “oncomplete” functionality to work, the function must be declared like this:

function myFunction(){ };

How do I get these two things to play nicely together. This is what one of my itween functions looks like:

iTween.MoveTo(lighter,{"y":-.8, "z":-.4, "time":1,"easeType": "easeInOutQuad","oncomplete":"lighterEnable"});

Your assumption is not correct. Maybe you’re accidentally trying to do something with “myFunction” in your code that’s not allowed for functions, and since your “fix” removes the compiler warning, it seems like it is correct.

Can you show us and/or check for yourself the script/the places where you use/access “myFunction” (or referring to your iTween problem, “lighterEnable”)? There must be a problem there (e.g., forgot the “()” when calling it, assigning it to something, …)