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

_root, _parent, _global are not members of MovieClip.prototype #768

Closed
Herschel opened this issue Jun 28, 2020 · 0 comments · Fixed by #6921
Closed

_root, _parent, _global are not members of MovieClip.prototype #768

Herschel opened this issue Jun 28, 2020 · 0 comments · Fixed by #6921
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2)

Comments

@Herschel
Copy link
Member

Currently we cheat by putting _root, _parent, and _global as properties on the prototype of MovieClip, Button, etc., but this isn't correct:
trace(MovieClip.prototype.hasOwnProperty("_root")); // false in Flash, true in Ruffle

Instead, these should be "special" properties inherent to StageObject, similar to _x, _y, and _rotation. The tricky part is that _root, _parent, and _global respect case-sensitivity, unlike the other special properties. That is, _RoTaTiOn works regardless of SWF version, but _RoOt only works in SWFv6 and below.

@Herschel Herschel added actionscript A-avm1 Area: AVM1 (ActionScript 1 & 2) labels Jun 28, 2020
Herschel added a commit to Herschel/ruffle that referenced this issue May 8, 2022
…rs#768)

Remove `_root`, `_parent` and `_global` from `MovieClip.prototype`.
Instead, these are "magic" properties similar to `_x` and `_y`.
Add `StageObject::resolve_path_property` to handle these, alongside
the `_levelN` property.

Fixes ruffle-rs#768.
Herschel added a commit to Herschel/ruffle that referenced this issue May 8, 2022
Herschel added a commit that referenced this issue May 10, 2022
Remove `_root`, `_parent` and `_global` from `MovieClip.prototype`.
Instead, these are "magic" properties similar to `_x` and `_y`.
Add `StageObject::resolve_path_property` to handle these, alongside
the `_levelN` property.

Fixes #768.
Herschel added a commit that referenced this issue May 10, 2022
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant