当仅加载SWF时,是否有可能设置页面的标题?
当仅加载SWF时,是否有可能设置页面的标题?
ExternalInterface.call("document.title = 'Hello World'");
function setPageTitle( newTitle : String ) : void {
var jsCode : String = "function( title ) { document.title = title; }";
ExternalInterface.call(jsCode, newTitle);
}
确定。这应该能帮助你:
getURL('javascript:var x = (document.getElementsByTagName("head")[0].getElementsByTagName("title")[0].firstChild.nodeValue = "This is a test!");');
只需将"This is a test!"替换为您的新标题。
我遇到了同样的问题,即设置页面标题。从下载aspFlash控件到使用swfObject等尝试了很多方法...
最终,我的团队领导提出了解决方案...
打开一个页面的弹出窗口,在该页面中使用一个IFrame,并使用IFrame加载swf文件。
因此,有两个页面,外部页面是我们的控制页面,只需设置标题...内部页面是IFrame,它只是另一个页面,因此通过设置scr="文件路径"直接加载swf文件。
我认为你应该能做到。你需要访问JavaScript DOM。
这里有几个链接,可能会指引你走向正确的方向。