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

[DRAFT] AVM2: Fixes for SimpleButton #7015

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

kmeisthax
Copy link
Member

This consists of all the SimpleButton-specific things that I'm about to pull out of #5876.

Note that as a result of factoring out the SimpleButton stuff, I had to ignore one of the SimpleButton tests in that PR, because the fix for that is now exclusively in this one.

This has a lot of guess-work about exactly when buttons run script initializers, and I still haven't figured out how it is supposed to work.

…ssible places:

1. If the button was placed at the start of the parent clip's timeline, immediately after all children run their frames.
2. Otherwise, during the next frame *destruction* event (after `exitFrame`, *not* before `frameConstructed`).
… if it was placed on frame 1 and has at least one `Up` child.
…ation if there's an up state.

We are also hacking around the delay code again. I spent like a whole day trying to figure out how Flash Player determines if `SimpleButton` gets constructed early or late and nothing made sense.
@Herschel
Copy link
Member

Herschel commented Sep 5, 2022

Is this PR still relevant after #7570 ?

@torokati44
Copy link
Member

AFAIK #5876 got split into #7570 and this.

@Aaron1011
Copy link
Member

I forgot about this PR, and started working on something similar on my own branch (adding a new test as well): https://github.com/Aaron1011/ruffle/tree/button-constr-order

I think I found the cause of a lot of the weirdness - all of the non-active button states should be treated as orphans, and have their frames/framescripts run by the orphan-handling code. This explains why the relative order of button state framescripts is sometimes different - the relative order of orphan framescripts seems to depend on some internal hash table iteration in Flash Player.

@kmeisthax
Copy link
Member Author

In that case if @Aaron1011 's PR goes through this probably should be abandoned. Most of this PR was based off the old version of the frame ordering PR that was then rewritten a few times anyway.

Does the orphan logic intersect with #10862 in any way?

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

Successfully merging this pull request may close these issues.

None yet

4 participants