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

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

Open
cyberix-3d opened this issue Jun 29, 2023 · 6 comments
Labels
avm2 AVM2 (ActionScript 3.0) issues bug Something isn't working flex Issues relating to Adobe Flex unimplemented Issues for functionality that hasn't been implemented yet

Comments

@cyberix-3d
Copy link

cyberix-3d commented Jun 29, 2023

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 cyberix-3d added the bug Something isn't working label Jun 29, 2023
@cyberix-3d cyberix-3d changed the title Error Dispatching EventObject Error Dispatching EventObject on: https://gamemaker3d.com/editor/index_flash.html Jun 29, 2023
@n0samu n0samu added avm2 AVM2 (ActionScript 3.0) issues flex Issues relating to Adobe Flex labels Jun 29, 2023
@n0samu
Copy link
Member

n0samu commented Jun 29, 2023

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.

@Lord-McSweeney
Copy link
Collaborator

Lord-McSweeney commented Jun 30, 2023

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
Copy link
Collaborator

Lord-McSweeney commented Nov 10, 2023

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

@Lord-McSweeney
Copy link
Collaborator

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.

@cyberix3d2
Copy link

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

@Aaron1011
Copy link
Member

Aaron1011 commented Jul 2, 2024

This is currently blocked on several things:

@evilpie evilpie added the unimplemented Issues for functionality that hasn't been implemented yet label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avm2 AVM2 (ActionScript 3.0) issues bug Something isn't working flex Issues relating to Adobe Flex unimplemented Issues for functionality that hasn't been implemented yet
Projects
None yet
Development

No branches or pull requests

6 participants