You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ruffle模拟器加载Flash游戏失败求助:无法获取SWF文件

问题描述

搭建集成Ruffle模拟器的网站时,启动后模拟器加载失败,无法运行Flash游戏《Toss The Turle》,核心报错为SWF文件获取失败。相关代码仓库地址:https://github.com/project-lulo/RuffleTest

错误详情

核心错误

错误名称: Error
错误消息: Failed to fetch: https://project-lulo.github.io/508440_tossTheTurtleV1NG.swf
错误栈:

Error: Failed to fetch: https://project-lulo.github.io/508440_tossTheTurtleV1NG.swf
    at N.displayRootMovieDownloadFailedMessage (https://unpkg.com/@ruffle-rs/ruffle:1:42817)
    at W.n.wbg.__wbg_displayRootMovieDownloadFailedMessage_1a5c34096259685a (https://unpkg.com/@ruffle-rs/ruffle/core.ruffle.166543534d0d6de8f27f.js:1:6048)
    at <ruffle_web::ui::WebUiBackend as ruffle_core::backend::ui::UiBackend>::display_root_movie_download_failed_message::h388897a81a8d9e4a (wasm://wasm/01800c06:wasm-function[6009]:0x4a4416)
    at <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hae136a348136f102 (wasm://wasm/01800c06:wasm-function[529]:0x1b1fd7)
    at <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h226af752124a8ae1 (wasm://wasm/01800c06:wasm-function[1044]:0x2a5ec8)
    at wasm_bindgen_futures::queue::Queue::new::{{closure}}::hde74cc58c6c5c016 (wasm://wasm/01800c06:wasm-function[2316]:0x3c9a4f)
    at <dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::haf48995076cdf3b9 (wasm://wasm/01800c06:wasm-function[5490]:0x494e2d)
    at closure2936 externref shim (wasm://wasm/01800c06:wasm-function[5611]:0x49753d)
    at S (https://unpkg.com/@ruffle-rs/ruffle/core.ruffle.166543534d0d6de8f27f.js:1:2706)
    at c (https://unpkg.com/@ruffle-rs/ruffle/core.ruffle.166543534d0d6de8f27f.js:1:2231)

环境信息

  • 玩家信息:允许脚本访问: true,渲染器: WebGL
  • 页面信息:页面URL: https://project-lulo.github.io/RuffleTest/,SWF URL: https://project-lulo.github.io/508440_tossTheTurtleV1NG.swf
  • 浏览器信息:User Agent: Mozilla/5.0 (X11; CrOS x86_64 14695.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36,平台: Linux x86_64,支持触摸: false
  • Ruffle信息:版本: 0.1.0,名称: nightly 2022-10-14,渠道: nightly,构建时间: 2022-10-14T00:22:21.438Z,提交哈希: b0b0e55c240e7d505d1ee64f61764de554885e5f,是否为扩展: false

解决方案

  1. 验证SWF文件可用性:直接访问SWF文件的URL,确认文件是否存在、能否正常下载。若返回404或无法下载,检查文件是否上传至对应路径,或路径拼写是否有误。
  2. 调整资源引用路径:优先使用相对路径引用SWF文件,比如将https://project-lulo.github.io/508440_tossTheTurtleV1NG.swf替换为./508440_tossTheTurtleV1NG.swf(需确保文件存放在网站根目录),避免绝对路径带来的域名或路径错误。
  3. 升级Ruffle版本:当前使用的是2022年的nightly版本,兼容性问题概率较高。建议替换为最新稳定版的CDN链接,新版本修复了大量加载和兼容性问题。
  4. 排查跨域问题:若页面与SWF文件域名不同,需确保服务器配置了正确的CORS响应头,允许页面域名访问该资源。对于GitHub Pages,将SWF文件放在同仓库目录下可避免跨域问题。
  5. 本地测试排查:在本地搭建静态服务器运行网站,验证是否能正常加载SWF文件,排除GitHub Pages的环境限制。

内容的提问来源于stack exchange,提问作者user20151407

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 19:45:42