我想让flash换一张图片显示,javascript改变了object的值了,为什么不见更新啊,请看以下的代码,谢谢<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script language="javascript">
function change() {
document.getElementById('flashvars').value='file=movie02.flv&image=movie02.jpg'
}</script>
<body>
<div class="movie"><object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="514" height="380">
                                                        <param name="movie" value="player.swf" />
                                                        <param name="allowfullscreen" value="true" />
                                                        <param name="allowscriptaccess" value="always" />
                                                        <param id="flashvars" name="flashvars" value="file=movie01.flv&image=movie01.jpg" />
                                                        <embed
                                                            type="application/x-shockwave-flash"
                                                            id="player2"
                                                            name="player"
                                                            src="player.swf"
                                                            width="514"
                                                            height="380"
                                                            allowscriptaccess="always"
                                                            allowfullscreen="true"
                                                            flashvars="file=video/movie07.flv&image=video/big07.jpg" />
                                                    </object></div>
                                                    <a href="javascript:change()">dddd</a>
                                                    
</body>
</html>

解决方案 »

  1.   

    用document.getElementById('flashvars').setAttribute("value","xxxx.jpg");试下
      

  2.   

    function change() {
    document.getElementById('flashvars').value='file=movie02.flv&image=movie02.jpg';
    alert(document.getElementById('flashvars').value);
    }可以看到那个标签的value值确实是更新了,我估计毛病不是出在这里。