ruffle-rs / ruffle

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

Receiving (Ruffle) Error dispatching event errors - similar experiences/ ideas how to debug/ resolve? #16419

Open uover822 opened 1 month ago

uover822 commented 1 month ago

Describe the bug

Hi All :-) I'm configuring/ launching Ruffle as follows:

var ruffle = window.RufflePlayer.newest(),player = Object.assign(document.getElementById(obj.id).appendChild(ruffle.createPlayer()), {width: widthStr, height: heightStr, style: 'width: ' + widthStr + 'px; height: ' + heightStr + 'px', });
player.config = {autoplay:'auto', logLevel: 'info'};
player.load({ url: swfUrlStr });

With the following object:

<object type="application/x-shockwave-flash" id="container_app" name="container_app" align="middle" data="UI.swf" width="100%" height="100%" style="visibility: visible;"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><param name="allowscriptaccess" value="sameDomain"><param name="allowfullscreen" value="true"><param name="menu" value="false"><param name="flashvars" value="locale=en_US&amp;localeChain=en_US&amp;resourceModuleURLs=locales/UI-en_US.swf&amp;csp="><param name="scale" value="noscale"><param name="wmode" value="opaque"></object>

Has anyone experienced similar issues or have ideas how t debug/ resolve these?

Thanks

Expected behavior

Expecting UI to be presented. Currently receiving the following errors during loading:

ruffle_web-wasm_extensions.js:932 ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0xa705e68 }) to handler FunctionObject(FunctionObject { ptr: 0x1456318, name: Ok("mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()") }) : ReferenceError: Error #1065: Variable UserSettingsCategoriesLoadRequestEvent is not defined.

ruffle_web-wasm_extensions.js:932 ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x99f3838 }) to handler FunctionObject(FunctionObject { ptr: 0x1443598, name: Ok("mx.managers::SystemManager/docFrameListener()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: name)

Content Location

UI.swf.gz

Affected platform

Browser's extension

Operating system

Windows 10 Enterprise

Browser

Google Chrome 125

Additional information

Some additional debug details are here:

# Player Info
Allows script access: true
Renderer: wgpu
Adapter Backend: Gl
Adapter Name: "ANGLE (Intel, Intel(R) UHD Graphics 620 (0x00003EA0) Direct3D11 vs_5_0 ps_5_0, D3D11)"
Adapter Device Type: IntegratedGpu
Adapter Driver Name: "WebGL 2.0 (OpenGL ES"
Adapter Driver Info: "3.0 Chromium)"
Enabled features: Features(TEXTURE_COMPRESSION_BC | FLOAT32_FILTERABLE | TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | SHADER_UNUSED_VERTEX_OUTPUT)
Available features: Features(DEPTH32FLOAT_STENCIL8 | PUSH_CONSTANTS | CLEAR_TEXTURE | MULTIVIEW)
Current limits: Limits { max_texture_dimension_1d: 16384, max_texture_dimension_2d: 16384, max_texture_dimension_3d: 2048, max_texture_array_layers: 256, max_bind_groups: 4, max_bindings_per_bind_group: 1000, max_dynamic_uniform_buffers_per_pipeline_layout: 8, max_dynamic_storage_buffers_per_pipeline_layout: 0, max_sampled_textures_per_shader_stage: 16, max_samplers_per_shader_stage: 16, max_storage_buffers_per_shader_stage: 0, max_storage_textures_per_shader_stage: 0, max_uniform_buffers_per_shader_stage: 11, max_uniform_buffer_binding_size: 65536, max_storage_buffer_binding_size: 0, max_vertex_buffers: 8, max_buffer_size: 268435456, max_vertex_attributes: 16, max_vertex_buffer_array_stride: 255, min_uniform_buffer_offset_alignment: 256, min_storage_buffer_offset_alignment: 256, max_inter_stage_shader_components: 120, max_color_attachments: 8, max_color_attachment_bytes_per_sample: 32, max_compute_workgroup_storage_size: 0, max_compute_invocations_per_workgroup: 0, max_compute_workgroup_size_x: 0, max_compute_workgroup_size_y: 0, max_compute_workgroup_size_z: 0, max_compute_workgroups_per_dimension: 0, min_subgroup_size: 0, max_subgroup_size: 0, max_push_constant_size: 0, max_non_sampler_bindings: 1000000 }
Surface quality: high
Surface samples: 4
Surface size: (550, 400, 1)
Player type: Object
SWF URL: UI.swf
Param quality: high
Param bgcolor: #ffffff
Param allowscriptaccess: sameDomain
Param allowfullscreen: true
Param menu: false
Param flashvars: locale=en_US&localeChain=en_US&resourceModuleURLs=locales/UI-en_US.swf&csp=
Param scale: noscale
Param wmode: opaque
Attribute 0: undefined
Attribute 1: undefined
Attribute 2: undefined
Attribute 3: undefined
Attribute 4: undefined
Attribute 5: undefined
Attribute 6: undefined
Attribute 7: undefined

# Page Info
Page URL: https://localhost/vsphere-client/?csp
SWF URL: https://localhost/vsphere-client/UI.swf

# Browser Info
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Platform: Win32
Has touch support: false

# Ruffle Info
Version: 0.1.0
Name: nightly 2024-05-22
Channel: nightly
Built: 2024-05-22T00:05:27.491Z
Commit: 671be1a810640bced86269e09cb050498b6ed18b
Is extension: false

# Metadata
width: 500
height: 375
frameRate: 24
numFrames: 2
swfVersion: 18
backgroundColor: undefined
isActionScript3: true
uncompressedLength: 536145
adrian17 commented 1 month ago

Unfortunately, this doesn't appear to be something you can do anything about directly.

The error is right - from looking at the UI.swf you provided, I don't see a class called UserSettingsCategoriesLoadRequestEvent defined anywhere. So it's either some missing side SWFs, or they exist but weren't loaded for some reason, or it's us missing some unknown to us way of defining event classes. I have no intuition of which of these it could be.

(btw, I also tried running your swf in the web demo and it didn't do anything, but it also didn't show your errors)

uover822 commented 1 month ago

Thanks, @adrian17 :-) Hi All: I also just tried running my swf in the web demo - receiving the attached.

UI swf err

Perhaps this error 2032 is indicating an expected/ missing source stream?

uover822 commented 1 month ago

Hi @adrian17 :-) What tool did you use to review the swf src/ code, btw?

danielhjacobs commented 1 month ago

Probably https://github.com/jindrapetrik/jpexs-decompiler. The devs for Ruffle use that often.