ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.4k stars 795 forks source link

Moto X3M 3 - The favorite series is in trouble... (White Screen) #11409

Closed desertking closed 1 year ago

desertking commented 1 year ago

Describe the bug

Wondering that no one posted this yet - White Screen :

Loading SWF file https://www.spiele-umsonst.de/azad/downloads/flashgames/motox3m3.swf

ruffle_web-wasm_extensions.js:716 ERROR core/src/display_object/movie_clip.rs:2141 Got "TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: length)" when constructing AVM2 side of movie clip of type Preloader

The same issue seems to be with part 2 dunno about all the others. Just tested those 2. Maybe they work when the error is fixed with the "preloader"?

Expected behavior

Load & Run

Affected platform

Online demo

Operating system

All

Browser

All

Additional information

No response

n0samu commented 1 year ago

This happens because the game's sitelock uses ExternalInterface within a try-catch block: var _loc4_:String = ""; _loc4_ = ExternalInterface.call("window.location.href.toString"); In AVM2, calling ExternalInterface where it is unavailable throws an AVM error. But Ruffle's ExternalInterface implementation returns null instead of throwing an error, which causes a problem here:

if(_loc4_.length > 0)
{
    param1 = _loc4_;
}

Trying to get the length of null causes an error, whereas in Flash Player _loc4_'s value remains the empty string.

desertking commented 1 year ago

I see will ruffle change this behavior?

n0samu commented 1 year ago

This should be fixed by #11415

desertking commented 1 year ago

Seems to work now. Sadly performance is too bad to unlock it in web mode.