兄弟我想通过javascript向asp传值,网上看了一些帖子 自己还是没搞定,请能人看看!~~~map.asp
<SCRIPT LANGUAGE=JavaScript>
function doPassVar(args,ts){
var sendText = args.value;
window.document.map.SetVariable("a", sendText);//a为在flash主体里定义的一个变量
var sendtaishu = ts.value;
window.document.map.SetVariable("b", sendtaishu);//b为在flash主体里定义的一个变量
window.document.map.TCallFrame("playerTime_mc",0);
}
</SCRIPT>
<p><strong>查询系统<br>
      </strong>类型:
 <select name="SerZhongLei" class="style3" id="SerZhongLei" >
<option value=" " >请选择</option>
<option value="1" >吊车</option>
         <option value="2" >项目</option>
  </select>  
          <br>
      吨位:
  <input name="sendText" type="text" size="10" maxlength="10" >
          <br>
      车主:
<input  type="submit" value="查找" onClick="doPassVar(sendText,SerZhongLei)">
              </p>flash中 map.fla
在主体里定义了两个变量
var  a;
var  b;
在主体中加入了一个剪辑 playerTime_mc_root.select.text = _root.a;//select为主体中的一个文本框
_root.taishu.text = _root.b;;//taishu为主体中的一个文本框
trace(_root.select);
trace(_root.taishu);
我的想法就是把:map.asp中 类型和吨位的值,传给flash中的两个文本框,select和taishu。现在运行 map.asp中总是报错 说map.asp中有"未知名定义",我估计是
window.document.map.TCallFrame("playerTime_mc",0);这一句有问题;
请大家看看!~~~跪求!~~
如小弟还有没说清楚地地方,请留言!~~~

解决方案 »

  1.   

    window.document.map. 
    =>
    document.getElementById("map") // map <= <object ..... id="map".....
      

  2.   

    window.document.map这个是啥?
    js调用,应该是
    document.all.idOrName  ->all后面接id或name,也可以这样写document.all("idOrName")
    document.getElementById("id");  ->通过id取对象
    document.getElementsByName("name");  ->通过name来取对象
      

  3.   

    小弟按照两位大哥说的把javascirpt改为:
    <SCRIPT LANGUAGE=JavaScript>
    function doPassVar(args,ts){
        var obj = parent.document.getElementById("map");//map为flash的id
    var sendText = args.value;
    obj.SetVariable("a", sendText);
    var sendtaishu = ts.value;
    obj.SetVariable("b", sendtaishu);
    obj.TCallFrame("playerTime_mc",0);
    }
    </SCRIPT>但问题还是没有解决,仍然出现显示obj.TCallFrame("playerTime_mc",0);有未指明的错误!~~
    请二位在给支支招!~~`
      

  4.   

    标题应该改为JS向FLASH影片传值:window.document.FLASH影片ID.SetVariable("FLASH里的变量名", minbet);
      

  5.   

    在主体中加入了一个剪辑 playerTime_mc_root.select.text = _root.a;//select为主体中的一个文本框
    _root.taishu.text = _root.b;;//taishu为主体中的一个文本框
    trace(_root.select);
    trace(_root.taishu);----------------------------------------------------------------
    把这段代码放在playerTime_mc的第2帧里去,在playerTime_mc第一帧加上stop();用obj.TCallFrame("playerTime_mc",1);调用脚本