Welcome! Login
Contents
Flashmap_DoFSCommand function and Netscape 
Article Rating
Current Rating  
Total Votes
Your Rating

Flash FSCommand function and Netscape

By designfirm 

Flashmap_DoFSCommand function and Netscape

 

Flash FSCommand function and Netscape:

If www.yourdomain.com and http://domain.com go to the same website server.
and you use Flash fscommand to send a document.location to another frame and this page also has javascript:
You will get 'Access denied cannot run a script from another server' error in Netscape 4.

use the window.location.hostname to resolve this.

next tip: Netscape 4 needs spaces converted to '+' in file names for flash commands: eg. New York must be New+York.
args = sTMP.replace(/ /g,'+'); will fix this.

<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var browser = InternetExplorer ? 'IE' : 'NS';
var myroot;

if (browser=='IE'){
myroot='';}
else{
myroot='http://'+window.location.hostname+'/yourpath/';}

function Flashmap_DoFSCommand(command, args) {

if (args=="") {parent.frame1.location=myroot+'screwup.htm';return false;}

sTMP = new String(args);
args = sTMP.replace(/ /g,'+');

if(command == "State") {parent.frame2.location=myroot+'client.asp?State='+args;}

if(command == "City"){
if (confirm('Find client in this city '+args+'?')){parent.frame2.location=myroot+'client.asp?city='+args;}
}
}

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 Flashmap_FSCommand(ByVal command, ByVal args)\n');
document.write(' call Flashmap_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
//-->
</SCRIPT>


Worth at least 4 stars because I searched 4 hours for this
and many had the problem but none had the answer.
 
This site was generated with CodeCharge