Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting LWF.Bounds of a LWF.Movie immediately #144

Open
DelSystem32 opened this issue Oct 9, 2015 · 1 comment
Open

Getting LWF.Bounds of a LWF.Movie immediately #144

DelSystem32 opened this issue Oct 9, 2015 · 1 comment

Comments

@DelSystem32
Copy link
Contributor

Right now it seems like the only way to get the bounds of a LWF.Movie is to do this:

private LWF.Bounds theBounds;
private void BoundsFetcher(LWF.Movie m) {
    theBounds = m.GetBounds();
}
public LWF.Bounds GetBounds (string mcInstanceName = null) {
    lwf.SearchMovieInstance ("instancename").RequestCalculateBounds(BoundsFetcher);
    lwf.Exec (-1);
    return theBounds;
}

However this means you have to update the flash once. Is there a better way to do it, without using RequestCalculateBounds()?

Or using RequestCalculateBounds() but not having to call Exec(-1)?

Edit: Changed the incorrect 0 to the correct -1.

@DelSystem32
Copy link
Contributor Author

A workaround would be to avoid calling Exec() and simply have LWF RequestCalculateBounds() after every single update that it does, on all its LWF.Movies. However then I ask how can I loop through all LWF.Movies in a LWFObject? I know about lwf.buttonHead to loop through all buttons however there isn't anything similar for movies or is there?

Edit: That workaround is no good since if a script repositions a MovieClip within the flash and then tries to get the bounds then the bounds will not have been updated to the changes. Seems like I need to call Exec(), meaning I will need to workaround the problem with any false enterFrame MovieEvents that might come out of the extra Exec() call. Note to anyone reading this: -1 should be given to Exec(), not 0.

Leaving question open since it would still be good to know if there is a way to get the bounds of a MovieClip without having to call Exec()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant