与editing swfobject.js code so hyperlinks inside the flash widget open in a new window相同(但没有回应)
我的内容中包含超链接的Flash内容。除了IE之外,所有浏览器中的链接都在新标签中打开。在IE中它作为POP-UP开放。所以客户要求修复它。
从Tridion CMS加载Flash内容。
{
var so = new SWFObject('/TridionMultimedia/wired-process_tcm24-2197.swf', 'wiredprocess', '680', '244', '8', '#ffffff');
so.useExpressInstall("/swf/expressinstall.swf");
so.addParam("quality", "high");
so.addParam('wmode', 'transparent');
so1.addParam('openLinksInNewWindow', 'true');//tried but not working
so.write('divtcm24-484-64tcm:24-783-32');
}
else
{
var so1 = new SWFObject('/TridionMultimedia/COSVideoWidgetRotating_tcm24-191.swf', 'mymovie', '680', '244', '6', '#FFFFFF');
so1.addParam("quality", "high");
so1.addParam('wmode', 'opaque');
so1.addParam('openLinksInNewWindow', 'true');//tried but not working
so1.write('divtcm24-484-64tcm:24-783-32');
}
在下面的网站中,我看到了一些代码 https://tagul.com/forums/topic/forcing-links-to-open-in-a-new-window
<script type="text/javascript">
swfobject.embedSWF("http://tagul.com/cdn/cloudTest.swf", "myCloud",
"600", "600", "10.0.0", "http://cdn.tagul.com/expressInstall.swf",
{id: "demo@demo", openLinksInNewWindow: "true"},
{allowscriptaccess: "always", bgcolor: "#ffffff"},
{id: "myCloudObject", name: "myCloudObject"});
但不确定如何添加我的脚本。或者这是与浏览器属性相关的东西。
谢谢,
答案 0 :(得分:3)
单击链接时,您可以引用运行此代码的函数:
var pageURL:String = ExternalInterface.call('YOUR_LINK');
navigateToURL(new URLRequest(pageURL), "_blank");
这应该可以解决问题。
答案 1 :(得分:0)
您可以使用[javascript + ExternalInterface]获取SWF点击事件URL并自行调用window.open。
检查此链接:
Using the ExternalInterface Class to Bridge JavaScript and Flash