function addplaylist(id){
         var sendText = id;
top.document.getElementById("myFlash").SetVariable("myVar", sendText);
}flash里有变量名为myVar的text,用JS在页面给FLASH传值,上面的函数在IE可以通过..但是在火狐下应该怎么写呢??\\\
网上查了下,但用下面这个函数也不行呢?..哪里写错了..连IE也执行不了了
function addplaylist(id){
         var sendText = id;
top.document.thisMovie("myFlash").SetVariable("myVar",sendText);
}    function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1)
     {
        return window[movieName]
    } else {
        return document[movieName]
    }

解决方案 »

  1.   

    执行addplaylist()函数 给flash传一个值myVar是FLASH里的一个文本的变量名,显示出页面JS传过来的参数
      

  2.   

    myFlash是页面上的FLASH的ID<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="690" height="76" id="myFlash">
              <param name="movie" value="flash/mp3player.swf" />
              <param name="quality" value="high" />
              <embed src="flash/mp3player.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="690" height="76" swLiveConnect="true"></embed>
            </object>
      

  3.   

    <embed name="myFlash" src="flash/mp3player.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="690" height="76" swLiveConnect="true"> </embed>在这个标签里加个name="myFlash"
      

  4.   

    JS调用Flash ,目前adobe 推荐使用的是ExternalInterface 类,自已找手册
      

  5.   

    js传质
    C_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','100%','height','100%','id','index','align','middle','viewastext','VIEWASTEXT','src','swf/index?online=true','quality','high','bgcolor','#ffffff','name','index','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','swf/index?online=true','flashvars','xml_txt=<?=$documentroot.$xml_path?>page<?=$tid?>.xml&zine_date=<?=date('d/m/y',$rs['posttime'])?>&url2=<?=$documentroot.make_url($rs["posttime"],"magzine",$rs["fid"],$rs["tid"])?>&url4=<?=$documentroot.$rs['backpath']?>&url5=<?=$documentroot.$rs['picpath']?>&url6=<?=$documentroot.$ad?>&urlroot=http://192.168.1.125/b/&form_title=<?=urlencode($title)?>' ); //end AC code
    </script>
    这是使用flashvars传值效率很高的
      

  6.   

    从网页给Flash传值,IE8没有问题,但是火狐3.6和火狐4都暂时不兼容。
      

  7.   

    top.document.getElementById("myFlash")
    ----------------------------------------------
    在浏览器上正确地播放一段Flash电影需要制作一个HTML页面,该页面中应该包括两个指导性标签信息,从而告诉浏览器如何打开并播放Flash电影,这两个标签就是"OBJECT"(对象)和"EMBED"(嵌入)。其中"OBJECT"标签应用于Windows系统下的Internet Explorer浏览器,"EMBED"标签应用于Windows系统和Macintosh系统下的Netscape Navigator浏览器以及Macintosh系统下的Internet Explorer浏览器。
    所以:
    IE浏览器认的是object
    FF浏览器认的是embed
      

  8.   

    http://blog.csdn.net/xiage/article/details/4528877