gpt4 book ai didi

javascript - ExternalInterface.addCallback 不起作用

转载 作者:行者123 更新时间:2023-11-28 11:42:32 24 4
gpt4 key购买 nike

这是我的 AC3 代码

private function uploadet( dosya:String ):void {

var uploader:URLRequest = new URLRequest(dosya);
localFile.upload(uploader);
}


var a = flash.external.ExternalInterface.addCallback("uploadet",uploadet);

这是 JavaScript

   <script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");



function uploadet(dosya){
var myFlashMovie = swfobject.getObjectById("myId");
myFlashMovie.uploadet(dosya);
}

</script>


<style type="text/css">
<!--
body {
background-color: #e6e6e6;
margin-top: 50px;
}
-->
</style></head>
<body >
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
<param name="movie" value="SimpleUploader.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="SimpleUploader.swf" width="300" height="120">
<!--<![endif]-->
<div>

</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<div id="flash" align="center">

</div>

<div align="center"><b>Javascript Feedback:</b></div>
<div align="center" id="output"></div>

<input type="button" name="Submit" value="Submit" onclick="uploadet('dsadsa.php');" />

我无法让它工作,感谢任何帮助。

谢谢

最佳答案

您必须在网络服务器上部署 Flash 应用程序才能对其进行测试(或使自己成为本地网络服务器)。如果您从本地主机将文件作为文件加载(file:///c:.....),则 Flash Player 将不允许您使用外部接口(interface)。

关于javascript - ExternalInterface.addCallback 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1675779/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com