您的位置:首页 > 其它

如何解决Flex发布的swf自动激活的问题

2009-09-08 15:02 411 查看
众所周知ActiveX控件需要自动激活方可使用,在编写ActiveX控件时只需要加入下面的代码即可。

int CPlayerLIVE3_Ctrl::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default

OnActivateInPlace (TRUE, NULL); // == UI-Activate the control

return COleControl::OnMouseActivate(pDesktopWnd, nHitTest, message);
}

这种方法在IE7下还是需要手动激活,ie6则不需要(ie6如果出现需手动激活,则要将一Xp的补丁包御

载).

ie下在网页中嵌入的swf也作为了一个ActiveX控件在运行 (wmode属性默认为window).
发现flex自已发布的项目可以自动激活,看了下代码,加入以下几句关键代码:
<script src="../JS/AC_OETags.js" language="javascript"></script>

AC_FL_RunContent(
"src", "IndexesVod",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "IndexesVod",
"quality", "high",
"bgcolor", "#edf4fd",
"name", "IndexesVod",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);

这样,基本满足要求,后来我发现这么一来无法实现全屏了,我分析了下AC_OETags.js的代码,
在AC_FL_RunContent中加入下面的属性就OK了。

"allowfullscreen","true"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: