Flash / TextField / Safari - 当 wmode 设置为透明时无法在文本字段中输入内容
当 wmode 透明时,为什么文本字段在 Safari 中无法正确捕获事件(在 ie/ff/chrome 中没有问题)?我发现的唯一解决方法包括通过外部接口发送 html 表单字段事件到 flash(例如,在 flash 上覆盖 html 表单)。这个问题有一个优雅的解决方案/解决方法吗?
编辑:Swfobject 嵌入代码...
<script>
var swfVersionStr = "10.2.0";
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
flashvars.swfsPath = "http://domain.com/swfs/";
flashvars.initial_section = "0";
var params = {};
params.quality = "high";
params.bgcolor = "#cfc7c0";
params.allowscriptaccess = "always";
params.allowfullscreen = "true";
params.wmode = (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) ? "transparent" : "opaque";
var attributes = {};
attributes.id = "Loader";
attributes.name = "Loader";
attributes.align = "middle";
swfobject.embedSWF(
flashvars.swfsPath + "Loader.swf", "Loader",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
swffit.fit("Loader", 980, 726);
</script>
Why are text fields not catching events properly in Safari when wmode is transparent (no problems in ie/ff/chrome)? The only workarounds I've found involve sending html form field events to flash through an external interface (eg. overlaying html form on flash). Is there a graceful solution / workaround to this problem?
Edit: Swfobject embed code...
<script>
var swfVersionStr = "10.2.0";
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
flashvars.swfsPath = "http://domain.com/swfs/";
flashvars.initial_section = "0";
var params = {};
params.quality = "high";
params.bgcolor = "#cfc7c0";
params.allowscriptaccess = "always";
params.allowfullscreen = "true";
params.wmode = (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) ? "transparent" : "opaque";
var attributes = {};
attributes.id = "Loader";
attributes.name = "Loader";
attributes.align = "middle";
swfobject.embedSWF(
flashvars.swfsPath + "Loader.swf", "Loader",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
swffit.fit("Loader", 980, 726);
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个很长一段时间以来的已知问题...我在洛杉矶的 MAX 大会上与 Adobe 进行了交谈,他们已经意识到了这一点,但目前没有计划修复它...抱歉,伙计
this is a known problem for a long time... I spoke to Adobe at the MAX Convention in LA and they are aware of it but no plans at the moment to fix it... sorry buddy