AS3调用jQuery函数函数、jQuery

2023-09-08 15:13:08 作者:人滿為患

我需要闪光灯交谈jQuery的。

下面是我的Flash code:

 如果(ExternalInterface.available)
{
 ExternalInterface.call('函数(){MyFunction的();}');
ExternalInterface.call('函数(){警报(赞美耶稣!);}');
}
 

警报的伟大工程。我的功能没有。

jQuery函数声明与调用

下面是我的jQuery的:

 <脚本类型=文/ JavaScript的>

  $(文件)。就绪(函数()
  {
  $(#flashContentABOVE)点击(MyFunction的);



  功能MyFunction的()
  {
            $(#flashContentABOVE)的CSS(z索引,4);

  }

  });
< / SCRIPT>
 

解决方案

把你的<脚本> 在HTML文件的底部(结束<身体GT; ),并采取了的document.ready()功能

I need flash to talk to jQuery.

Here is my Flash code:

if (ExternalInterface.available) 
{
 ExternalInterface.call('function(){ MyFunction(); }');
ExternalInterface.call('function(){ alert("Praise Be Jesus Christ!"); }');
}

The "Alert" works great. My function does not.

Here is my jQuery:

<script type="text/javascript">

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



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

  }

  });
</script>

解决方案

Put your <script> tag at the bottom of your html file (before the closing <body>), and take out the document.ready() function.