Open 123jjck opened 3 hours ago
CC @Toad06
This game loads internal SWFs. One of the files contains the following code:
this.onRollOver = function() {
mco.gotoAndStop("over_fr");
ShowHint(this_mc);
};
this.onRollOut = this.onReleaseOutside = function() {
mco.gotoAndStop("out_fr");
RemoveHint();
};
If you open the file directly in Flash Player or Ruffle, this won't work because this
refers to the root. For the same reason, this issue also occurs if you load it into a different level using loadMovieNum
.
However, loading the file into a target movie clip that is part of the root works in Flash Player:
this.createEmptyMovieClip("container", this.getNextHighestDepth());
loadMovie("child.swf", "container");
This doesn't work in Ruffle because fn is_root
returns true
in this situation, as this function actually indicates "whether this display object represents the root of loaded content".
So replacing the is_root
check with DisplayObject::ptr_eq(self.as_displayobject(), self.avm1_root_no_lock())
prevents the issue from occurring.
Describe the bug
Expected behavior
Buttons respond to pointing and pressing:
Content Location
https://xarium.cc/playtest.php
Affected platform
Self-hosted version
Operating system
Windows 11
Browser
Google Chrome 131.0.6778.70
Additional information
Probably due to #18434 - nightly-2024-11-03 works fine, but starting with nightly-2024-11-05 there are problems