Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
as3调用jQuery函数_Jquery_Actionscript 3_Flash_Z Index - Fatal编程技术网

as3调用jQuery函数

as3调用jQuery函数,jquery,actionscript-3,flash,z-index,Jquery,Actionscript 3,Flash,Z Index,我需要flash与jQuery对话 这是我的闪存代码: if (ExternalInterface.available) { ExternalInterface.call('function(){ MyFunction(); }'); ExternalInterface.call('function(){ alert("Praise Be Jesus Christ!"); }'); } “警报”非常有效。我的功能不起作用 以下是我的jQuery: <script type="text

我需要flash与jQuery对话

这是我的闪存代码:

if (ExternalInterface.available) 
{
 ExternalInterface.call('function(){ MyFunction(); }');
ExternalInterface.call('function(){ alert("Praise Be Jesus Christ!"); }');
}
“警报”非常有效。我的功能不起作用

以下是我的jQuery:

<script type="text/javascript">

  $(document).ready(function()
  { 
  $("#flashContentABOVE").click(MyFunction);



  function MyFunction()
  {
            $("#flashContentABOVE").css("z-index", 4 );

  }

  });
</script>

$(文档).ready(函数()
{ 
$(“#FlashContentOver”)。单击(MyFunction);
函数MyFunction()
{
$(“#flashcontentover”).css(“z-index”,4);
}
});

将您的
标记放在html文件的底部(在关闭
之前),并取出
document.ready()
函数。

您应该能够直接从swf调用MyFunction。我总是这样称呼外部接口:

ExternalInterface.call("funcName","param1","param2");

试着把它放在就绪功能之外。太棒了!就这样!因为你回答得太快了,所以我连“那是对的”都点不上。非常感谢。我很快会查的。您确定删除document.ready()函数不会在其他地方给我带来问题吗?它的目的是什么?
document.ready()
捕获在加载DOM并准备进行操作时触发的事件。由于我们已将
script
标记放在页面底部,因此我们已经确定浏览器已加载上述元素。知道如何从jQuery调用actionscript 3函数吗?知道如何从jQuery调用actionscript 3函数吗?