Haxe - "Void should be Void -> Void"


#1

Hi guys,

I’m trying to use the animation functions animation.notifyOnMarker and animation.play(with OnComplete) to run functions when the animation hits a marker and when it is completed, however I keep getting the error “Void should be Void -> Void”. I’ve made the functions to be :Void and also made them return null but I keep getting the error.

Has anyone ever managed to make this kind of functions work? How is the exact syntax that I should use?


#2

Hello,

Can you paste your code? Example usage:

animation.notifyOnMarker("my_marker", function() {
	trace("Marker!");
});

#3

Oh, I see! I thought it was animation.notifyOnMarker(“my_marker”, doSomething()); with doSomething () being a function declared elsewhere in the code! Thank you!


#4

animation.notifyOnMarker(“my_marker”, doSomething); would works as well (notice the missing brackets).