Closed Thread Icon

Topic awaiting preservation: Blah, JS optimization? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8090" title="Pages that link to Topic awaiting preservation: Blah, JS optimization? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Blah, JS optimization? <span class="small">(Page 1 of 1)</span>\

 
eyezaer
Lunatic (VI) Mad Scientist

From: the Psychiatric Ward
Insane since: Sep 2000

posted posted 02-23-2002 04:44

Hi! My name is eyezaer and JS make my head want to explode!

I was trying to get the status bar to change when buttons in flash are moused over. I went on over to Macromedia and they said that It can be done for windows or for macs, I dont really believe that, but I dont care that much... It is just the status bar... So, after 3 buttons, is there a way to make this code any smaller? I have three buttons and each uses a slightly different version of the code...

quote:
<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function cp_DoFSCommand(command, args) {
var cpObj = InternetExplorer ? cp : document.cp;
if (command=="setStatus") {
window.status = args;
}

}
// Hook for Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub cp_FSCommand(ByVal command, ByVal args)\n');
document.write(' call cp_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function wd_DoFSCommand(command, args) {
var wdObj = InternetExplorer ? wd : document.wd;
if (command=="setStatus") {
window.status = args;
}
}
// Hook for Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub wd_FSCommand(ByVal command, ByVal args)\n');
document.write(' call wd_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function sg_DoFSCommand(command, args) {
var sgObj = InternetExplorer ? sg : document.sg;
if (command=="setStatus") {
window.status = args;
}
}
// Hook for Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub sg_FSCommand(ByVal command, ByVal args)\n');
document.write(' call sg_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}

//-->
</SCRIPT>



It works, and is on my page at http://cerebralboy.com

*looks at Rets -- this is harder than I thought it would be*

eyezaer
Lunatic (VI) Mad Scientist

From: the Psychiatric Ward
Insane since: Sep 2000

posted posted 02-23-2002 04:52

Huh, well if I can roll the 3 buttons into one flash movie... I would only need that stuff one time. Yeck...

[This message has been edited by eyezaer (edited 02-23-2002).]

ShadowImage
Nervous Wreck (II) Inmate

From: Melbourne, Victoria, Australia
Insane since: Mar 2001

posted posted 02-23-2002 07:01

Umm....
I remember you can call JavaScript functions using "GetURL" or something like that too
Instread of having it open a URL, have it as : javascript:window.status='the Status')

Haven't tested it, but it may work...
Then you wouldn't need the VB code and FS Commands for all three buttons.


« BackwardsOnwards »

Show Forum Drop Down Menu