如何将 flashvars 属性与 swfobject.embedSWF 一起使用?
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>
我想用干净的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将其创建为像参数和属性一样的对象:
you create it as an object like the params and attributes:
从闪存中,您可以通过执行以下操作来提取变量:
From flash you can pull up the vars by doing: