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

onEnterFrame executes after Movie Clip is unloaded #19434

Open
Kwing95 opened this issue Feb 3, 2025 · 1 comment
Open

onEnterFrame executes after Movie Clip is unloaded #19434

Kwing95 opened this issue Feb 3, 2025 · 1 comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) A-avm2 Area: AVM2 (ActionScript 3) bug Something isn't working

Comments

@Kwing95
Copy link

Kwing95 commented Feb 3, 2025

Describe the bug

If a Movie Clip is unloaded, onEnterFrame will continue to execute if it is defined.

Expected behavior

onEnterFrame should stop executing when a Movie Clip is unloaded.

Content Location

ruffle-bug-2025a.zip

Affected platform

Desktop app

Operating system

Windows, Android

Browser

Chrome 132.0.6834.83

Additional information

This code, placed inside of a Movie Clip, will reproduce the issue:

var counter:Number = 0; onEnterFrame = function(){ counter += 1; trace(counter); if(counter > 10){ unloadMovie(this); } }

On Flash the counter will terminate at 11; on Ruffle it will continue to count indefinitely.

@Kwing95 Kwing95 added the bug Something isn't working label Feb 3, 2025
@Lord-McSweeney Lord-McSweeney added A-avm2 Area: AVM2 (ActionScript 3) A-avm1 Area: AVM1 (ActionScript 1 & 2) labels Feb 4, 2025
@Lord-McSweeney
Copy link
Collaborator

This is probably the cause of many of the remaining audio looping issues. IIRC when a MovieClip is unloaded it runs all its frames but does not loop at the end (and is probably GCed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) A-avm2 Area: AVM2 (ActionScript 3) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants