ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Console looks is just looping continuously because "broadcastMessage is not callableEmbedded SWF (flash) into html doesn't run in Ruffle.

Open winston895 opened this issue 5 years ago • 7 comments

Embedded SWF (flash) into html doesn't run in Ruffle, and it was suggested that I post the file(s) here for a developer to look at. (may be the missing puzzle to get Ruffle being more compatible. )

winston895 avatar Jan 06 '21 07:01 winston895

The FluidsandElectrolytes.zip file contains 1 html file + 1 folder (which contains 6 files including the SWF file). The SWF is version 8, appears to be AVM1, and the problem per the console looks like it's just looping continuously because "broadcastMessage is not callable."

winston895 avatar Jan 06 '21 07:01 winston895

@winston895 did you mean to close your issue btw?

Poopooracoocoo avatar Jan 06 '21 09:01 Poopooracoocoo

Sorry, I did not mean to close the issue. Any help would be appreciated.

winston895 avatar Jan 06 '21 14:01 winston895

are there any updates on this issue?

Bale001 avatar Jan 26 '21 02:01 Bale001

Haven't looked at this deeply yet, but a "not callable" message itself is not necessarily a problem -- in fact, we've disabled warning logs by default in recent web builds. Calling a non-existent method happens quite often in AVM1 content. Specifically the Flash built-in BroadcasterMX component lazily initializes the broadcastMessage method, so broadcastMessage doesn't exist, which is totally fine -- the call is just a no-op. So the warning message is red herring.

I need to investigate this more, but I suspect this particular instance is another case of #1535. The AS execution stops because of a goto, when it shouldn't because the clip should be kept alive by an unload handler.

In DefineSprite 10009:

      if(percent > 99.5)
      {
          // This gotoAndPlay causes the clip to be destroyed and execution to bail out in Ruffle, but it doesn't in Flash Player
         _parent._parent.gotoAndPlay(2);
         // Execution does not continue here
         gotoAndStop("off");
         doneLoading = 1;
      }

Herschel avatar Jan 26 '21 03:01 Herschel

TLDR: This isn't due to #1535, the header in this swf tells lies.

According to the header in this SWF frameCount = 2, in reality there are 77 frames. When the enterFrame event is dispatched to sprite 10009, it invokes preload(), this function contains the code from @Herschel comment above, which moves the stage to frame 2. After executing frame 2, in Flash Player it then moves to frame 3, however in Ruffle it assumes that there are no more frames because it trusts the header and it loops back to frame 1.

Here's a basic example, runs 3 frames in Flash but only 2 in Ruffle (manually hex-edited): trust_nothing.zip

And here is a heavily cut down version of the linked swf with debug traces, loops in Ruffle, doesn't in Flash: fluids2.zip

Temporarily patching Ruffle to ignore the header (annoyingly frame count is one of the few header fields that JPEXS can't edit), makes it sort-of work: image

I'm guessing we will have to ignore the frame count in the header and check ahead for any extra frames before looping back

CUB3D avatar Dec 22 '22 04:12 CUB3D

Fixed by #21526

Lord-McSweeney avatar Sep 08 '25 03:09 Lord-McSweeney