Flash module add-on: Any solutions to avoid --click to activate flash???
Re: Flash module add-on: Any solutions to avoid --click to activate flash???
Hi Jimmy,
I tried out a javascript solution that works on our 1.7 site at least in a course description. Making this kind of thing work with the flash quiz activity module would be a different story I'm sure. In the description I put:
<script src="http://somesite.com/fooIndex.js" type="text/javascript"></script>
<script type="text/javascript">RunFoo();</script>
and fooIndex.js looks like:
function RunFoo()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="171" height="100">\n');
document.write('<param name="movie" value="\n'">http://somesite.com/courseFlash/acti.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<embed src="http://somesite.com/courseFlash/acti.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="171" height="100"></embed>\n');
document.write('</object>\n');
}
Tom
Re: Flash module add-on: Any solutions to avoid --click to activate flash???
Many thanks for your help. Since I embed my swf files using <object> tags I am still a bit confused about the following:
Where should I upload the fooindes.js file.
And should I type this script <script src="http://somesite.com/fooIndex.js" type="text/javascript"></script>
<script type="text/javascript">RunFoo();</script>
before the object tags (where i embed my swf)
Cheers
Jimmy
Re: Flash module add-on: Any solutions to avoid --click to activate flash???
Hi Jimmy,
You could put the fooindex.js file anywhere really. You just make the code you put in the editor reflect it's location:
<script src="http://somesite.com/anywhere/fooIndex.js" type="text/javascript"></script>
<script type="text/javascript">RunFoo();</script>
and then fooindex.js has all of the object/embed code. For some reason calling a function with the document.write and object tag fakes out IE:
function RunFoo()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="171" height="100">\n');
document.write('<param name="movie" value="\n'">http://somesite.com/courseFlash/acti.swf">\n');
document.write('<param name="quality" value="high">\n');
document.write('<embed src="http://somesite.com/courseFlash/acti.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="171" height="100"></embed>\n');
document.write('</object>\n');
}
Hope it helps. I'm sure there are some more sophisticated ways of doing it and probably more "relative" ways. You could also have a master .js file that had all the flash for your site and you just call out the functions. I'll play with it some more. Tom
Re: Flash module add-on: Any solutions to avoid --click to activate flash???
Jimmy