从Flash中的按钮我只想调用一个用jQuery编写的函数。
当我把函数放在jQuery的$(document).ready之外时,它工作正常:
* btw我使用SWFObject来嵌入Flash。Flash AS3 ExternalInterface调用jQuery文档中的函数准备
AS3:
import flash.external.ExternalInterface;
function test_fnc(event:Event):void {
ExternalInterface.call("jsFunction", "hello world");
}
test_mc.addEventListener("click", test_fnc);
JS:
<script type="text/javascript">
function jsFunction(words) {
alert(words); // "hello world";
}
$(document).ready(function() {
// not from here
});
</script>
这真的不清楚你在问什么。为什么需要在$(document).ready中定义一个函数? – spender 2010-03-02 00:54:07
我需要访问与jQuery创建一个阵列。 \t \t \t \t VAR alt_array = $( “#缩略图IMG”)地图(函数(){ \t \t \t \t \t回$(本).attr(“ALT “); \t \t \t \t}); – FFish 2010-03-02 00:57:44