lwf.AddMovieEventHandler(lwf.rootMovie.instanceId, enterFrame:MyHandler);
void MyHandler(LWF.Movie m) {
Debug.Log("hello");
}
If I call:
lwf.Exec (0);
lwf.Exec (0);
Or:
lwf.UpdateLWF(0);
lwf.UpdateLWF(0);
I still get "hello" printed out several times, even though there has been 0 milliseconds since the last time the method was called, which is not enough time to enter another frame. This can't be intended behavior, right?
Actually, if I run this code...
int id = lwf.AddMovieEventHandler(lwf.rootMovie.instanceId, enterFrame:MyHandler);
UpdateLWF(0);
lwf.RemoveMovieEventHandler(lwf.rootMovie.instanceId, id);
...then "hello" is printed out three times, just from that single UpdateLWF()! Even though it is only called once between adding and removing the handler and the tick is zero time.
Edit: Seems like Exec() wants -1 where UpdateLWF() wants 0. UpdateLWF calls Exec and if UpdateLWF received 0 as tick it will change tick to -1 for Exec. Kinda confusing, especially since the suggested value for the optional parameter "tick" in Exec is set to 0.
I have this code:
If I call:
Or:
I still get "hello" printed out several times, even though there has been 0 milliseconds since the last time the method was called, which is not enough time to enter another frame. This can't be intended behavior, right?
Actually, if I run this code...
...then "hello" is printed out three times, just from that single UpdateLWF()! Even though it is only called once between adding and removing the handler and the tick is zero time.
Edit: Seems like Exec() wants -1 where UpdateLWF() wants 0. UpdateLWF calls Exec and if UpdateLWF received 0 as tick it will change tick to -1 for Exec. Kinda confusing, especially since the suggested value for the optional parameter "tick" in Exec is set to 0.