tags:

views:

290

answers:

6

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

A: 

I only have a lead: There are ways to have Flash apps invoke Javascript.

Kevin Conner
A: 

I would think you would be able to do it. You would have to access the 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/

madcolor
+1  A: 

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.

64BitBob
A: 

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.

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

81bronco
+4  A: 

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);
}
Theo
A: 

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....

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.

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"

sagarvarule