| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Mar 2003
Posts: 15
|
Hi, I'm using flash as the GUI, and I would like to change the HTML title, when i move from one frame to another. I have the javascript and it works fine:
JS: function updateTitle(newTitle){ //alert(newTitle); document.title = newTitle; } As you can see i have an alert commented out. If i use the alert I can see i get the newTitle from flash, however when I try to use the javascript to update the page title, nothign happends. When i use the javascript in a regular HTML page, the javascript works fine. Actionscript in file: function updateTitle(newTitle){ getURL("javascript: updateTitle('"+newTitle+"')"); } updateTitle("test"); I've tried adding "_self" to the getURL call, all that does is replace my page with the getURL call. |
|
|
|
|
|
#2 |
|
WHAT!?
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
|
have you tried sendAndLoad() insted of getURL();
PHP Code:
|
|
|
|
|
|
|
|
|
#3 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
this works for me:
Code:
this.getURL("javascript: window.document.title='Set Title'; void(0);");
Code:
this.getURL("javascript: window.document.title='"+newTitle+"'; void(0);");
__________________
tg --- what the hell was i thinking? Last edited by tg; 11-03-2004 at 05:57 PM.. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Mar 2003
Posts: 15
|
sad to say it didn't work. I even tried it in a blank flash file on the first frame. I'm using Flash MX2004, and IE 6.0.29 with SP2
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Mar 2003
Posts: 15
|
ok, so i installed Mozilla, and it works great. Apparently it's something with IE... Odd, casue I am able to manipulate the title outside of Flash, perhaps some sort of active-x violation? ohh well, thanks for the help.
|
|
|
|
|
|
#6 | |
|
CookieDog
Join Date: Oct 2004
Posts: 107
|
This will change the title for you, and works in IE:
Put this in your Flash .swf on your button or wherever you are triggering your page change from: fscommand("changeTitle",newTitle); Put this in your HTML doc as Javascript: Quote:
|
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Mar 2003
Posts: 15
|
awesome! only had to change you line for the main object to:
var mainObj = isInternetExplorer ? document.all.swfID : document.swfID; |
|
|
|
|
|
#8 |
|
CookieDog
Join Date: Oct 2004
Posts: 107
|
Oops! Sorry, I forgot to change that part. My .swf ID was "main", but it should be changed to whatever your .swf ID is, which you already figured out. And that line is related to this line that I forgot to include (it assigns the value to 'InternetExplorer'):
This line is outside of the mySwf_DoFSCommand function, and before it: var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; Anyway, glad you got it working! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|