Skip to content

Updating the flash with a delta time of 0 still calls OnEnterFrame #145

Description

@DelSystem32

I have this code:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions