views:

299

answers:

2

I have a function in jquery I would like run in flash using action script 2.0

The Jquery:

<script>
$(document).ready(function(){  
$("a").click(function(event){
      $("div#Header").height(97)
       .css({cursor:"auto", backgroundColor:"#FCC"});
 });
});
</script>

The Html

<a href="#">Run</a>

How I do this in actionscript 2.0?

+1  A: 

ExternalInterface lets you call Javascript functions from Flash. The simplest thing to do would be to place your code inside a Javascript function defined in the HEAD of the page (or otherwise above where the SWF is embedded), then call:

ExternalInterface.call("yourFunctionName");

More on ExternalInterface in this old SO question.

Ben
Thanks Ben, but my problem is not to run javascript so I do this "getURL("javascript:popupMessage()");" works well, but a jquery I am having trouble.
Mango
A: 

In the above example, the "yourFunctionName" should be replaced with what?

ExternalInterface.call("function(event)")

or what?

mayo