从SWF设置页面标题

时间:2022-12-04 22:57:23

Is it possible to set the title of a page when it's simply a loaded SWF?

当它只是一个加载的SWF时,是否可以设置页面的标题?

5 个解决方案

#1


5  

This is how I would do it:

我就是这样做的:

ExternalInterface.call("document.title = 'Hello World'");

Or more generalized:

或者更一般化:

function setPageTitle( newTitle : String ) : void {
  var jsCode : String = "function( title ) { document.title = title; }";

  ExternalInterface.call(jsCode, newTitle);
}

#2


2  

Sure. This should fix you up:

当然。这应该会解决你的问题:

getURL('javascript:var x = (document.getElementsByTagName("head")[0].getElementsByTagName("title")[0].firstChild.nodeValue = "This is a test!");');

Just replace "This is a test!" with your new title.

只需替换“这是一个测试!”用你的新头衔。

#3


0  

I would think you would be able to do it. You would have to access the javascript DOM.

我认为你能做到。你必须访问javascript DOM。

A couple links that may steer you down the correct path..

一些链接可能会引导您走正确的路径..

http://homepage.ntlworld.com/kayseycarvey/document2.html

http://www.permadi.com/tutorial/flashjscommand/

#4


0  

You could use SWFAddress, it has a setTitle method. Plus, you get the added benefit of beng able to modify the URL for deep-linking.

您可以使用SWFAddress,它有一个setTitle方法。此外,您还可以获得能够修改深层链接URL的额外好处。

EDIT: This won't work if the SWF is loaded directly in the browser, only if it is embedded in HTML.

编辑:如果SWF直接加载到浏览器中,只有嵌入在HTML中,这将不起作用。

#5


0  

I came up with the same problem of setting up the title of my page. Madw hell lot of efforts from downloading aspFlash controls to those swfObject....

我想出了设置页面标题的相同问题。 Madw从下载aspFlash控件到swfObject ....

Finally my team lead came up the solution....

最后,我的团队负责人提出了解决方案....

open the pop of one page and in that page use one IFrame and use the Iframe to load the swf file.

打开一个页面的弹出窗口,在该页面中使用一个IFrame并使用Iframe加载swf文件。

So there are 2 page outer one is our control so just set the title.. inner one is the Iframe which is just another page so load the swf file directly by setting the scr="file path"

所以有两个页面外部是我们的控件所以只需设置标题..内部一个是iframe,它只是另一个页面,所以通过设置scr =“文件路径”直接加载swf文件

#1


5  

This is how I would do it:

我就是这样做的:

ExternalInterface.call("document.title = 'Hello World'");

Or more generalized:

或者更一般化:

function setPageTitle( newTitle : String ) : void {
  var jsCode : String = "function( title ) { document.title = title; }";

  ExternalInterface.call(jsCode, newTitle);
}

#2


2  

Sure. This should fix you up:

当然。这应该会解决你的问题:

getURL('javascript:var x = (document.getElementsByTagName("head")[0].getElementsByTagName("title")[0].firstChild.nodeValue = "This is a test!");');

Just replace "This is a test!" with your new title.

只需替换“这是一个测试!”用你的新头衔。

#3


0  

I would think you would be able to do it. You would have to access the javascript DOM.

我认为你能做到。你必须访问javascript DOM。

A couple links that may steer you down the correct path..

一些链接可能会引导您走正确的路径..

http://homepage.ntlworld.com/kayseycarvey/document2.html

http://www.permadi.com/tutorial/flashjscommand/

#4


0  

You could use SWFAddress, it has a setTitle method. Plus, you get the added benefit of beng able to modify the URL for deep-linking.

您可以使用SWFAddress,它有一个setTitle方法。此外,您还可以获得能够修改深层链接URL的额外好处。

EDIT: This won't work if the SWF is loaded directly in the browser, only if it is embedded in HTML.

编辑:如果SWF直接加载到浏览器中,只有嵌入在HTML中,这将不起作用。

#5


0  

I came up with the same problem of setting up the title of my page. Madw hell lot of efforts from downloading aspFlash controls to those swfObject....

我想出了设置页面标题的相同问题。 Madw从下载aspFlash控件到swfObject ....

Finally my team lead came up the solution....

最后,我的团队负责人提出了解决方案....

open the pop of one page and in that page use one IFrame and use the Iframe to load the swf file.

打开一个页面的弹出窗口,在该页面中使用一个IFrame并使用Iframe加载swf文件。

So there are 2 page outer one is our control so just set the title.. inner one is the Iframe which is just another page so load the swf file directly by setting the scr="file path"

所以有两个页面外部是我们的控件所以只需设置标题..内部一个是iframe,它只是另一个页面,所以通过设置scr =“文件路径”直接加载swf文件