让 SWFObject 更新 flash,但不需要它

发布于 2024-12-06 06:37:19 字数 848 浏览 1 评论 0原文

我有一款游戏在 Flash Player 11(带有 Molehill)中运行得更好,但在 10.3 中也能运行。我想让玩家尽可能通过快速安装自动更新到 11(当然是在发布之后),但不想强迫他们。

我尝试用 SWFObject 嵌入它:

swfobject.embedSWF(
    // url
    "game.swf?version=1",
    // content to replace
    "flashContent",
    // size
    "910", "658",
    // flash version
    "11",
    // expressInstall
    "playerProductInstall.swf",
    // flashvars
    {},
    // params
    {
        wmode: "transparent",
        allowScriptAccess: "always"
    },
    // object attributes
    {},
    // callback
    function(e) {
        if (e.success) {
            console.log("SWF loaded", e);
            gameSwf = e.ref;
        } else {
            console.log("SWF not loaded", e);
        }
    }
);

但是,这将使游戏需要 11,这意味着如果快速安装不起作用(Linux)或被用户取消,则游戏将被取消。未加载,即使它可以正常运行。

还有另一种方法可以做我想做的事吗?

I have a game that will work better in Flash Player 11 (with Molehill) but also works in 10.3. I'd like to get players to automatically update to 11 with express install as much as possible (after it's released, of course), but don't want to force them.

I tried this way of embedding it with SWFObject:

swfobject.embedSWF(
    // url
    "game.swf?version=1",
    // content to replace
    "flashContent",
    // size
    "910", "658",
    // flash version
    "11",
    // expressInstall
    "playerProductInstall.swf",
    // flashvars
    {},
    // params
    {
        wmode: "transparent",
        allowScriptAccess: "always"
    },
    // object attributes
    {},
    // callback
    function(e) {
        if (e.success) {
            console.log("SWF loaded", e);
            gameSwf = e.ref;
        } else {
            console.log("SWF not loaded", e);
        }
    }
);

However, that will make the game require 11, which means that if express install doesn't work (Linux) or is cancelled by the user, the game is not loaded, even though it would run fine.

Is there another way to do what I want?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

香橙ぽ 2024-12-13 06:37:19

制作所需版本10.3
然后编写javascript检测版本是否为11。如果不是,则显示更新链接。

更好的是只需要 fp11,它不会造成任何伤害

Make the required version 10.3
Then write javascript to detect if the version is 11. If not, show the update link.

Better still would be to just require fp11, it will cause no harm

能否归途做我良人 2024-12-13 06:37:19

与 Pravnav 的回答类似,我会使用 10.3 嵌入游戏,然后在电影上方放置一个小横幅,说明他们的 Flash Player 版本已过时,并且游戏在 FP 11+ 下性能最佳。使横幅可点击并使用 swfobject 的 swfobject.showExpressInstall 方法来触发快速安装。

棘手的部分是快速安装支持:正如您所说,EI 在 Linux 中不起作用,但它在 Google Chrome 中也不起作用,因为 Chrome 使用嵌入式自我更新版本的 FP。编写一些嗅探 JS 为这些浏览器提供 Adob​​e.com 的链接而不是使用快速安装可能会很有用。

Similar to Pravnav's answer, I would embed the game using 10.3, then place a small banner above the movie that says their version of Flash Player is out of date and the game performs best with FP 11+. Make the banner clickable and use swfobject's swfobject.showExpressInstall method to trigger Express Install.

The tricky part is Express Install support: as you said, EI doesn't work in Linux, but it also doesn't work in Google Chrome, since Chrome uses an embedded self-updating version of FP. Might be useful to write some sniffing JS that provides a link to Adobe.com for those browsers instead of using Express Install.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文