Link to home
Start Free TrialLog in
Avatar of Mach1pro
Mach1pro

asked on

multiple swf files play when browser requires scroll bars

I have a flash movie and I can adjust its size somewhat depending on the screen resolution using javacript. The problem I am having is that if the movie plays in a browser and the browser has extra toolbars that force the screen to use vertical scrollbars, then my movie starts playing two instances at the same time. Why is this happening?
Avatar of rootdir
rootdir

use following javascript to open your movie in browser

config='titlebar=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no'

and check how many times you call flash movie. May be you are calling 2 times.

RootDir
Avatar of Mach1pro

ASKER

rootdir,
Your code didn't work or I didn't implement it properly.
I just dropped it between some javascript tags in the head.

I'm not calling the movie twice. As long as there are no scrollbars, then it only plays a single instance. I am able to get around this problem by dropping the movie inside a table and it works regardless if there are scrollbars or not.
The points are still out here if you or someone can come up with a solution not using a table. If you need me to I can drop the table tags and give you a link to the files.
post your code let me see what you are doing? or can you upload to any site?

RootDir
rootdir,
It appears that this problem is only happening in Netscape7. IE seems to handle it fine. If you want to test this go to the following address:
http://www.peerlessroadchurch.com/children/
    Make sure you have enough toolbars and status bar open to force the target page to produce scroll bars. The movie should play two instances and you can scroll down to see the second instance. Now remove the extra toolbars and reload the page so that there is no scrollbars. The target page should only display one instance.

Here is the code from the taget  page, you can use ViewSource to see the code on the Frames page:
<HTML>
<HEAD>
<TITLE>kkintro</TITLE>
<script language="javascript">
<!--
config='titlebar=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no';

 //-->
 </script>
</HEAD>
<BODY bgcolor="#000033" marginwidth="0" leftmargin="0" topmargin="0" marginheight="0">

<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!-- <table><tr><td> -->
<script language="javascript">
<!--
if(screen.width == 800){
document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=492 HEIGHT=380>');
 document.write ('<PARAM NAME=movie VALUE="kkintro.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000033> <EMBED src="kkintro.swf" quality=high bgcolor=#000033  WIDTH=492 HEIGHT=380 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
 } else {
 document.write ("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=750 HEIGHT=575>");
 document.write ('<PARAM NAME=movie VALUE="kkintro.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000033> <EMBED src="kkintro.swf" quality=high bgcolor=#000033  WIDTH=750 HEIGHT=575 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
 }
 
 //-->
 </script>
 <!-- </td></tr></table> -->
</BODY>
</HTML>

1. I think you need to reload page in netscape, use following javascript function

<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>

2. You can not paste this code directly inside html HEAD "config='titlebar=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no';
". This is part of window.open function.

Check window.open javascript function.

Cheers
RootDir
rootdir,
I pasted your code in the head of the target page and it didn't change a thing. I tried it in the body and still no change. The only thing that I changed on your code is the reference to appVersion. I'm using netscape 7.
rootdir,
Did you give up on me?
If you don't have anymore suggestions, I need to add the table back to my webpage.
take out the EMBED tags..the document write is 'embedding' the..(flash movie)..OBJECT..

try this..



<HTML>
<HEAD>
<TITLE>kkintro</TITLE>

</HEAD>
<BODY bgcolor="#000033" marginwidth="0" leftmargin="0" topmargin="0" marginheight="0">
<script language="javascript">
<!--
if(screen.width == 800){
document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=492 HEIGHT=380>');
document.write ('<PARAM NAME=movie VALUE="button2.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000033> < WIDTH=492 HEIGHT=380 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
} else {
document.write ("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=750 HEIGHT=575>");
document.write ('<PARAM NAME=movie VALUE="buton2.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000033> < WIDTH=750 HEIGHT=575 TYPE="application/x-shockwave-flash">');
}
//-->
</script>
</BODY>
</HTML>

Z
sorry..changed your file name for testing..

button2.swf  should be..kkintro.swf

Z
Zeffer,
Sorry I didn't get back with you sooner on this.
Using the code you sent won't even load the swf into the  Netscape browser.  Netscape needs the Embed statement for this file. I guess I will just let the file sit inside a table.
ASKER CERTIFIED SOLUTION
Avatar of Zeffer
Zeffer
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Zeffer,
Thanks for your patience. The problem stems from Frontpage.
I did have a closing object tag, but because the opening object tag was within Javascript, Frontpage thought I didn't know what I was doing and deleted the closing tag when I saved the page. I was able to add the closing object tag in notepad, and it seems to solved the problem.