AS3调用jQuery函数 [英] as3 calling jQuery function

查看:113
本文介绍了AS3调用jQuery函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要闪光灯交谈jQuery的。

下面是我的Flash code:

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

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

下面是我的jQuery的:

 <脚本类型=文/ JavaScript的>

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



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

  }

  });
< / SCRIPT>
 

解决方案

把你的&LT;脚本&GT; 在HTML文件的底部(结束<前标签code>&LT;身体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.

这篇关于AS3调用jQuery函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆