-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
avm1: References to removed clips should be "resurrected" if the name is reused #1513
Comments
Herschel
added
bug
Something isn't working
actionscript
A-avm1
Area: AVM1 (ActionScript 1 & 2)
labels
Nov 6, 2020
This was referenced Apr 23, 2021
This was referenced Jun 19, 2021
4 tasks
Herschel
added a commit
to Herschel/ruffle
that referenced
this issue
Oct 17, 2021
AVM1 display objects do not actually hold pointers to their display object, but instead refer to them indirectly via string path (for example, `_level0.clip.foo`). This means: * Every property access on an AVM1 display object requires re-resolving the path to the actual object. * If that display object is removed from the stage, the AVM1 object still exists, but the the path no longer resolves to a display object, so the reference is "dangling". Any operations on the AVM1 object are noops. * If a display object with the same path is later added to the stage, the AVM1 object will once again resolve, and all operations will work using the new display object. Fixes ruffle-rs#993, ruffle-rs#1415, ruffle-rs#1513, ...
CUB3D
pushed a commit
to CUB3D/ruffle
that referenced
this issue
Dec 31, 2022
AVM1 display objects do not actually hold pointers to their display object, but instead refer to them indirectly via string path (for example, `_level0.clip.foo`). This means: * Every property access on an AVM1 display object requires re-resolving the path to the actual object. * If that display object is removed from the stage, the AVM1 object still exists, but the the path no longer resolves to a display object, so the reference is "dangling". Any operations on the AVM1 object are noops. * If a display object with the same path is later added to the stage, the AVM1 object will once again resolve, and all operations will work using the new display object. Fixes ruffle-rs#993, ruffle-rs#1415, ruffle-rs#1513, ...
24 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following sequence:
var clipRef = clip;
on frame 1.trace(clipRef);
traces the empty string (clip is dead, but not implemented yet, cc [Skeleton Park] Issue with a specific animation #993).trace(clipRef);
magically prints_level0.clip
even thoughclipRef
was never updated.This seems like
avm1::StageObject
must store the canonical path to the movieclip, and will automatically point to a new clip if that path is ever reused. Some research is needed to determine the exact behavior, and hopefully figure out an efficient implementation (worst case is we have to parse the path on every use, which would be bad...!) My hope is that we can limit this check to only when the original clip is removed.Example SWF using timeline:
dead-mc-timeline.zip
Example SWF using
createEmptyMovieClip
twice w/ same name and depth:dead-mc.zip
I believe this causes #1415 and #1509. Related to #993.
The text was updated successfully, but these errors were encountered: