swf是别人的,我看了下他代码,有如下这个:js代码如下:
code=html]
<input type="button"  value="Get LaTeX from editor and display" onclick="alert(getSWF('editML').getLaTeX());focusEditor();"/>[
<div id="Div1" style="width:870;height:400;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="editML"  align="middle">
<param name="allowScriptAccess" value="always"/>
<param name="allowFullScreen" value="true"/>
<param name="loop" value="false"/>
<param name="quality" value="high" />
<param name="flashVars" value="htmlId=1&width=800&height=400"/>
<param name="movie" value="MathMLEditor.swf" />
<embed src="MathMLEditor.swf"
flashVars="htmlId=1&width=800&height=400"
loop="false"
quality="high"
width="100%"
height="100%"
    name="editML"
align="middle"
allowScriptAccess="always"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div><script> function focusEditor(){
var editor = getSWF('editML');
editor.focus();
} function getMathMLFromJavascript(){
alert("call javascript method getMathMLFromJavascript\n; The method must return a mathml");
focusEditor();
return "<mrow><mtext>new value</mtext></mrow>";
} function saveMathMLToJavascript(mathML){
alert("call javascript method saveMathMLToJavascript with parameter:\n" + mathML);
focusEditor();
} function setFileNameFromServer(name){
alert(name);
} function getElement(id) {
return document.getElementById ? document.getElementById(id) : document.all[id];
} function getSWF(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return getElement(movieName);
}
else {
  if(document[movieName].length != undefined){
  return document[movieName][1];
  }
return document[movieName];
}
} focusEditor();</script>
[/code]
一直抱错:TypeError: getSWF(...).getLaTeX is not a function,不明白,为什么调不成功!javascriptswf

解决方案 »

  1.   

    有没有有正版的硕思闪客的?要改swf文件源码
      

  2.   

    getLaTeX是什么?是你定义的吗?
      

  3.   

    有没有可能是JS调用的时候Flash还没有加载完?或者AS代码在执行到注册回调函数之前出错了
      

  4.   


    知道原因了,是安全问题,本地访问静态页面不行,放在Tomcat里就行了,伤不起!