Dynamic Page Titles

Posted on October 05, 2006

I like the dynamic page titles on this flash site. Very simple, but I can't remember seeing it before. When the user moves to different sections of the site, flash calls a simple javascript that changes the title element in the html document.

function setTitle(title)
	document.title = title;

Here's an example page.

Download the example files

Animated page titles: the new status bar ticker?

Comments (9)

vinyl said

that's pretty cool.

Posted by: vinyl at October 5, 2006 11:39 PM .

Nasir said

It is very helpful.

Posted by: Nasir at October 6, 2006 09:17 AM .

ss said

Just out of curiosity - what is the flash call? I tried this on a button and no such luck:

on (release) {

Sorry… i am not very quick…

Posted by: ss at December 21, 2006 04:40 AM .

bsn said

@ss: try writing "javascript" in lower-case. (BTW: It's always a good idea to say what browser / flash version you are using when something isn't working.)

Here's an example page. I used the DOM this time for the JavaScript, although the old skool version worked perfectly well (at least in Safari/Firefox).

Posted by: bsn at December 21, 2006 08:43 AM .

ss said

Thanks! Sorry i did forget to mention pertinate info • Platform:Mac | Browser: Safari + Firefox | Flash: 8.0 | Flash Plugin: 8,0,22,0

I kicked arround with this thing last night for two hours and did eventually get it working - however - the only way i got it to work was to publish it as flash 7.

The same thing is true for the example you just posted. Thank you for takeing the time to do that btw. :)

I have a suspission that the "getURL" call does not work in Flash 8 as they have added the ExternalInterface class.

Posted by: ss at December 21, 2006 04:53 PM .

ss said

Ok - This is REALLY wierd!

First - thank you so much for replying and making the test file that you did. I do appreciate it!

Info: Mac OS 10.4.8 | Flash 8 | Safari/Firefox | Flash Plugin 8,0,22,0

This is the weird thing - I did get it to work after I posted last night. I blew a couple of hours to find this:

If I test the file from my computer's desktop the only way it works is if it is published as a Flash 7 file - if I publish it as Flash 8, it does NOT work.

I get the same results from your example file - Published as Flash 8 and tested from my desktop, does NOT work. Published as Flash 8 and tested from a web server, does work.

Holds true on both my home machine and now work.

Posted by: ss at December 21, 2006 05:08 PM .

bsn said

Hi SS,

now i know what you're talking about! The flash security settings get in the way if you don't test the file from a web server. I test locally through the localhost, so I didn't notice. If I test from the file system I get a security dialog from adobe.


Posted by: bsn at December 21, 2006 05:36 PM .

ss said

Yes, that must be it. Boy, i really liked Actionscript a whole lot more before Flash 8. :(

Thanks again, and sorry for that double post. I thought i had closed the first one. (I always come off looking like an idiot on the web)

Posted by: ss at December 21, 2006 06:09 PM .

M.Isik said

This is a very nice function. Thanks ...

Posted by: M.Isik at May 16, 2007 01:20 AM .