Hi,
I'm trying to include this javascript file
<script type="text/javascript" src="swfobject.js"></script>
in the function below, but get an error saying I can't use nested scripts. How can I use this file inside the function doSomething. Also how to keep all the page coding outside the function so it doesn't disappear when I click on the button? Thanks for your help this is really doing my head in
####################################
<script type="text/javascript">
function doSomething(str)
{
var flashvars = {};
/* audio player parameters */
flashvars.audio = "str";
//flashvars.autoplay = falses;
/* end */
var params = {};
params.scale = "noscale";
params.allowfullscreen = "true";
params.salign = "tl";
var attributes = {};
attributes.align = "left";
/* embed audio player */
// adapt the path to flashaudioplayer.swf and expressInstall.swf
// adapt the display size of the flash file
swfobject.embedSWF("flashaudioplayer.swf", "audioPlayer", "200", "35", "9.0.28", "expressInstall.swf", flashvars, params, attributes);
/* end */
document.write ('<div id=audioPlayer style=margin:0px> </div>');
}
</script>
<button type="button" onclick="doSomething('str');" return false;>track play</button>
I'm trying to include this javascript file
<script type="text/javascript" src="swfobject.js"></script>
in the function below, but get an error saying I can't use nested scripts. How can I use this file inside the function doSomething. Also how to keep all the page coding outside the function so it doesn't disappear when I click on the button? Thanks for your help this is really doing my head in
####################################
<script type="text/javascript">
function doSomething(str)
{
var flashvars = {};
/* audio player parameters */
flashvars.audio = "str";
//flashvars.autoplay = falses;
/* end */
var params = {};
params.scale = "noscale";
params.allowfullscreen = "true";
params.salign = "tl";
var attributes = {};
attributes.align = "left";
/* embed audio player */
// adapt the path to flashaudioplayer.swf and expressInstall.swf
// adapt the display size of the flash file
swfobject.embedSWF("flashaudioplayer.swf", "audioPlayer", "200", "35", "9.0.28", "expressInstall.swf", flashvars, params, attributes);
/* end */
document.write ('<div id=audioPlayer style=margin:0px> </div>');
}
</script>
<button type="button" onclick="doSomething('str');" return false;>track play</button>