Papa De Beau
Papa De Beau

Reputation: 3828

as3 calling jQuery function

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>

Upvotes: 0

Views: 1269

Answers (2)

gregoryb
gregoryb

Reputation: 81

You should be able to call MyFunction directly from your swf. I always call ExternalInterface like:

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

Upvotes: 0

ahren
ahren

Reputation: 16959

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

Upvotes: 1

Related Questions