如何使用JavaScript交换瑞士法郎在HTML? [英] How to use javascript to swap swf in html?
本文介绍了如何使用JavaScript交换瑞士法郎在HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$('movie')。value ='swf / bhts.swf';
alert($('movie')。value);
该值确实改变为swf / bhts.swf,但仍然在播放原始的swf文件。 ..
这是我用来嵌入的代码swf
< object classid =clsid:D27CDB6E-AE6D -11cf-96B8-444553540000width =530height =298id =flashcontent>
< param id =moviename =movievalue =swf / trailer.swf/>
< / object>
谢谢。
解决方案
使用swfObject:
< div id ='flashContent'>
< / div>
< script type ='text / javascript'>
//设置你的初始flash
var so = new SwfObject(.....);
so.write('flashContent');
//一些事件处理程序
someElement.onclick = function()
{
//装载新的SWF
so = new swfObject(。 ...);
so.write('flashContent');
}
< / script>
I embedded a swf in my html page, but I would like it to swap to another swf when I clicked on a button in html. I used swfobject.js to embed the swf, and I use prototype to write the javascript. I thought I can just do this
$('movie').value = 'swf/bhts.swf';
alert($('movie').value);
the value did change to swf/bhts.swf, but it is still playing the original swf file... this is the code I use to embed swf
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="530" height="298" id="flashcontent">
<param id="movie" name="movie" value="swf/trailer.swf" />
</object>
thanks.
解决方案
Using swfObject:
<div id='flashContent'>
</div>
<script type='text/javascript'>
// Setup your initial flash
var so = new SwfObject(.....);
so.write ('flashContent');
// Some event handler
someElement.onclick = function ()
{
// Load up the new SWF
so = new swfObject(....);
so.write('flashContent');
}
</script>
这篇关于如何使用JavaScript交换瑞士法郎在HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文