ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Error Dispatching EventObject on: https://gamemaker3d.com/editor/index_flash.html

Open cyberix-3d opened this issue 2 years ago • 7 comments

Describe the bug

I'm experiencing an issue with the following link: https://www.gamemaker3d.com/editor/index_flash.html When I access it, I receive the following error message: ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0x3c405dc }) to handler FunctionObject(FunctionObject { ptr: 0x55236c }) : RustError("Cannot set prototype of class to null or undefined")

Additionally, there are multiple errors related to accessing SWZ files from Adobe. These errors are occurring due to CORS restrictions:

Access to fetch at 'https://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz' from origin 'https://www.gamemaker3d.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
339.js:1348     GET https://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz net::ERR_FAILED 200

Access to fetch at 'https://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz' from origin 'https://www.gamemaker3d.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
339.js:1348     GET https://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz net::ERR_FAILED 200

I kindly request your assistance in resolving these issues. Thank you in advance.

Expected behavior

I expected the link to load without any errors and for the event dispatching of the EventObject to be handled successfully without any issues.

Affected platform

Desktop app

Operating system

Windows 10

Browser

Google chrome 114

Additional information

No response

cyberix-3d avatar Jun 29 '23 07:06 cyberix-3d

Hi, it looks like you included the needed SWZ files on your site, and Ruffle is correctly falling back to those, so there is no problem there. As for the AVM2 error you mentioned, it's most likely caused by a problem that happened earlier. For example, a variable that is supposed to have a value may not have been properly initialized by Ruffle.

There are also a lot of warnings like this:

WARN core/src/display_object/movie_clip.rs:862 Got AVM2 error ReferenceError: Error #1069: Property mx.core::ByteArrayAsset not found on global and there is no default value.
	at global$init() [TU=frame2] when attempting to assign symbol class feathers.themes.AzureMobileTheme_ATLAS_FONT_XML`

I also see some mentions of classes like:

  • com.hurlant.eval.CompiledESC_util_tamarin_abc
  • com.hurlant.eval.CompiledESC_parse_abc
  • com.hurlant.eval.CompiledESC_ast_abc

I wonder if that means your app embeds its own mini ActionScript VM / parser. If so, that's scary advanced! Overall this looks like exactly the kind of super-complex application that will take longest for Ruffle to be able to support.

n0samu avatar Jun 29 '23 08:06 n0samu

This issue is because mx.core::ByteArrayAsset doesn't need to actually be looked up until the class that extends it is instantiated, by which time ByteArrayAsset will be defined by loaded SWZ files (specifically framework_4.6.0.23201.swz). This should be resolved in the ClassObject refactor.

Lord-McSweeney avatar Jun 30 '23 05:06 Lord-McSweeney

This spits out a bunch of errors now, and many visual elements are missing, but it now manages to finish loading.

Lord-McSweeney avatar Nov 10 '23 23:11 Lord-McSweeney

This has progressed, but now panics:

panicked at core/src/avm2/vtable.rs:170:58:
index out of bounds: the len is 2 but the index is 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
AVM2 stack trace: 
	at Function/nsEquals()
	at Parse::Rib/openNamespace()
	at Parse::Context/pushNamespace()
	at Parse::Parser/program()
	at Function/compile()
	at com.hurlant.eval::CompiledESC/eval()
	at Eval/compile()
	at Eval/run()
	at MethodInfo-1437()
	at Cyberix3DEngine/RemoveLoadingFunc()
	at MethodInfo-1529()

This is probably unrelated to the optimizer since it still happens with --no-avm2-optimizer: the issue is more likely that we aren't doing the slot_id bounds check in Object::set_slot.

Lord-McSweeney avatar Apr 07 '24 22:04 Lord-McSweeney

Now it is not causing a panic, which is a good progress!

However, I’ve encountered another problem when submitting a request to the AMF PHP server. The server returns a “service not found” error, even though everything worked fine when using Flash.

Could you please look into this issue?

Thank you!

https://www.gamemaker3d.com/editor/index_flash.html

Screenshot 2024-06-16 at 13 47 49

cyberix3d2 avatar Jun 16 '24 11:06 cyberix3d2

This is currently blocked on several things:

  • Stage.mouseLock stub (https://github.com/ruffle-rs/ruffle/pull/16963)
  • Fixing callproplex on a class (https://github.com/ruffle-rs/ruffle/pull/16962)
  • Implementing IExternalizable handling (this is the cause of the incorrect request to the AMF PHP server).

Aaron1011 avatar Jul 02 '24 02:07 Aaron1011

This is now stuck at loading with core/src/net_connection.rs:56 Unhandled error sending Status callback: TypeError: Error #1034: Type Coercion failed: cannot convert Object@00000000000 to mx.messaging.messages.ErrorMessage.

SuchAFuriousDeath avatar Nov 30 '25 01:11 SuchAFuriousDeath