onclick - Change Parameter Value with javascript -
i have ffmp3 embed code , trying change flashvars parameter value javascript possible?
i came far no luck:
<a id="foo" href="#">change radio</a> <object width="205" height="109" bgcolor="#ffffff"> <param name="movie" value="ffmp3-config.swf" /> <param name="flashvars" value="radio1" /> <param name="wmode" value="transparent" /> <param name="scale" value="noscale" /> <embed src="ffmp3-config.swf" flashvars="url=radio1" width="205" scale="noscale" height="109" wmode="transparent" bgcolor="none" type="application/x-shockwave-flash" /> </object> <script type="text/javascript"> var foo = document.getelementbyid('foo'); foo.onclick = function () { document.getelementsbyname('flashvars')[0].value='radio2'; } </script>
in short: yes, possible change html-elements value javascript. guess, might not in way expect.
the flashplayer object query params, when loaded first time. therefore changing param, while flashplayer running might not affect current stream.
but can solved:
either place available objects during first page load (hidden), set autoplay false, hide/unhide objects required, , trigger start using javascript.
not change
flashvars
element using javascript, generate "complete" flashplayer object dynamically required.directly modify flashplayers url, instead of params
... creative :)
Comments
Post a Comment