如何将 flashvars 属性与 swfobject.embedSWF 一起使用?

发布于 2024-11-26 11:51:03 字数 1769 浏览 2 评论 0原文

HTML:

<div class="playerFlashBox">
    <object width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" data="/flash/Player.swf" >
        <param name="movie" value="/flash/Player.swf">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
        <param name="quality" value="high" />
        <param name="wmode" value="opaque">
        <param name="FlashVars" value="ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>" />
        <embed width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" src="/flash/Player.swf" class="playerBox"
            allowScriptAccess="sameDomain"
            allowFullScreen="true"
            quality="high"
            flashVars="ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>"
            pluginspage="http://www.adobe.com/go/getflashplayer"
        ></embed>
    </object>
</div>

Javascript:

<script type="text/javascript">
    var flashvars = {
        "ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>"
    };
    var params = {
        allowScriptAccess: "sameDomain", 
        allowFullScreen: "true",
        wmode: "opaque",
        quality: "high",
        menu: "false"
    };
    var attributes = {}; attributes.styleclass="playerBox";

    swfobject.embedSWF("/flash/Player.swf", "playerFlashBox", "800", "450", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

我想用干净的 swfobject 语句替换它。我只是不知道如何使用 flashvars 属性。有什么想法吗?

HTML:

<div class="playerFlashBox">
    <object width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" data="/flash/Player.swf" >
        <param name="movie" value="/flash/Player.swf">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
        <param name="quality" value="high" />
        <param name="wmode" value="opaque">
        <param name="FlashVars" value="ProjectId=<%= @project.id.to_s %>&Language=<%= @locale %>" />
        <embed width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" src="/flash/Player.swf" class="playerBox"
            allowScriptAccess="sameDomain"
            allowFullScreen="true"
            quality="high"
            flashVars="ProjectId=<%= @project.id.to_s %>&Language=<%= @locale %>"
            pluginspage="http://www.adobe.com/go/getflashplayer"
        ></embed>
    </object>
</div>

Javascript:

<script type="text/javascript">
    var flashvars = {
        "ProjectId=<%= @project.id.to_s %>&Language=<%= @locale %>"
    };
    var params = {
        allowScriptAccess: "sameDomain", 
        allowFullScreen: "true",
        wmode: "opaque",
        quality: "high",
        menu: "false"
    };
    var attributes = {}; attributes.styleclass="playerBox";

    swfobject.embedSWF("/flash/Player.swf", "playerFlashBox", "800", "450", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

I want to replace this with a clean swfobject statement. I just have no clue how to work with the flashvars attribute. Any ideas?

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

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

发布评论

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

评论(2

我早已燃尽 2024-12-03 11:51:03

您将其创建为像参数和属性一样的对象:

var flashvars = {
    PrjectId:"<%= @project.id.to_s %>",
    Language:"<%= @locale %>"
};

you create it as an object like the params and attributes:

var flashvars = {
    PrjectId:"<%= @project.id.to_s %>",
    Language:"<%= @locale %>"
};
请你别敷衍 2024-12-03 11:51:03

从闪存中,您可以通过执行以下操作来提取变量:

var flashVars:Object = this.root.loaderInfo.parameters;
var projectId:String = flashVars["PrjectId"];
var language:String = flashVars["Language"];

From flash you can pull up the vars by doing:

var flashVars:Object = this.root.loaderInfo.parameters;
var projectId:String = flashVars["PrjectId"];
var language:String = flashVars["Language"];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文