如何制作具有透明背景的Flash电影

时间:2020-03-05 18:38:45  来源:igfitidea点击:

Adobe的此页面说要添加" wmode"参数并将其值设置为" transparent":http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_1420

这在IE中完美无缺。在Firefox和Safari中,背景可以正确呈现,但是,一旦使用浏览器的滚动条,然后将鼠标悬停在Flash控件上,就必须单击一次以激活该控件。如果尝试在Adobe的示例中单击播放按钮,则可以看到此行为。

有人知道解决这个问题的方法吗?

解决方案

回答

启用无窗口模式(wmode =)可使嵌入式Flash像其他元素一样起作用并进行渲染。没有它,它会在一个单独的步骤中呈现,并仅覆盖在浏览器的窗口中。

闪光灯元件会失去焦点吗?听起来输入焦点已移至scollbar,然后我们必须将其移回。

我们也不清楚焦点问题是仅在FF中还是在IE中。

回答

在背景透明的情况下,Adobe示例在Firefox 3.0.1中"有效"。但是,在Firefox 3.0.1和Safari 3.1.2中,我们必须单击两次播放按钮才能观看动画。

回答

另一个注意事项;将wmode设置为transparent有一些麻烦。例如,在某些旧版本的Firefox(2.0版之前)中,它可能会中断滚动(无论滚动如何,闪光灯都停留在同一位置)。当wmode透明时,我也遇到了文本字段中的ALT键组合不起作用的问题。

另外,如果需要将html内容放在flash内容之上(通常不是一个好主意,但是在某些情况下很有用)wmode = transparent是可行的方法。

回答

在花了更多时间之后,我同意@grapefrukt。将wmode设置为透明会导致各种奇怪的问题,我认为应该避免。

相反,我求助于传递背景色作为参数。我使用以下ActionScript绘制背景。

var parameters:Object = LoaderInfo(this.root.loaderInfo).parameters;
opaqueBackground = parameters["background-color"];

编辑:感谢@grapefrukt使我想起了bgcolor参数(这使得上面的ActionScript完全不必要)

回答

我们知道嵌入时可以设置背景颜色吗?

The following attributes are optional when defining the object and/or embed tags. For object , all attributes are defined in param tags unless otherwise specified:
  
  bgcolor - [ hexadecimal RGB value] in the format #RRGGBB . Specifies the background color of the movie. Use this attribute to override the background color setting specified in the Flash file. This attribute does not affect the background color of the HTML page.

从http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=1剪切'n粘贴