naimex
14-04-07, 06:50
If my memory serves me right, then the way to avoid the "click to activate this activex object" bullshit microsoft put into internet explorer, can be avoided if you attach the flash objects from an external javascript file.
so:
-Create a javascript file called "flash.js"
-Contents of "flash.js":
function flash1(){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="260" id="nc_22_head" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fileadmin/nc21_flash/nc_22_head.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="fileadmin/nc21_flash/nc_22_head.swf" quality="high" bgcolor="#000000" width="800" height="260" name="nc_22_head" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flash2(){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="200" id="teaser_box" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fileadmin/nc21_flash/teaser_box_en.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="fileadmin/nc21_flash/teaser_box_en.swf" quality="high" bgcolor="#000000" width="500" height="200" name="teaser_box" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
if the above doesnt work, then you have to put it into variables and build it up as you go along. ie.
function examplebuild(){
test = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="200" id="teaser_box" align="middle">';
test += '<param name="allowScriptAccess" value="sameDomain" />';
test += '<param name="movie" value="fileadmin/nc21_flash/teaser_box_en.swf" />';
test += '<param name="quality" value="high" /><param name="bgcolor" value="#000000" />';
test += '<embed src="fileadmin/nc21_flash/teaser_box_en.swf" quality="high" bgcolor="#000000" width="500" height="200" name="teaser_box" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
test += '</object>';
document.write(test);
}
the thing with javascript is, it has a really hard time reading variables that go on multiple lines, so its important that you have a full line ending with ; or '; in 1 line.
-then in the top of the website file, you write:
<script language="javascript" src="flash.js"></script>
-and then where you want the first flash to be, you just write:
<script language="javascript">
flash1();
</script>
-and where you want the other flash to be, you write:
<script language="javascript">
flash2();
</script>
I'm writing this mainly because, I hate clicking the stupid button.
so:
-Create a javascript file called "flash.js"
-Contents of "flash.js":
function flash1(){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="260" id="nc_22_head" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fileadmin/nc21_flash/nc_22_head.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="fileadmin/nc21_flash/nc_22_head.swf" quality="high" bgcolor="#000000" width="800" height="260" name="nc_22_head" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flash2(){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="200" id="teaser_box" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fileadmin/nc21_flash/teaser_box_en.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="fileadmin/nc21_flash/teaser_box_en.swf" quality="high" bgcolor="#000000" width="500" height="200" name="teaser_box" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
if the above doesnt work, then you have to put it into variables and build it up as you go along. ie.
function examplebuild(){
test = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="200" id="teaser_box" align="middle">';
test += '<param name="allowScriptAccess" value="sameDomain" />';
test += '<param name="movie" value="fileadmin/nc21_flash/teaser_box_en.swf" />';
test += '<param name="quality" value="high" /><param name="bgcolor" value="#000000" />';
test += '<embed src="fileadmin/nc21_flash/teaser_box_en.swf" quality="high" bgcolor="#000000" width="500" height="200" name="teaser_box" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
test += '</object>';
document.write(test);
}
the thing with javascript is, it has a really hard time reading variables that go on multiple lines, so its important that you have a full line ending with ; or '; in 1 line.
-then in the top of the website file, you write:
<script language="javascript" src="flash.js"></script>
-and then where you want the first flash to be, you just write:
<script language="javascript">
flash1();
</script>
-and where you want the other flash to be, you write:
<script language="javascript">
flash2();
</script>
I'm writing this mainly because, I hate clicking the stupid button.