From a button in Flash I just want to call a function written in jQuery.
When I place the function outside jQuery's $(document).ready it works fine:
*btw I use SWFObject to embed Flash.
AS3:
import flash.external.ExternalInterface;
function test_fnc(event:Event):void {
    ExternalInterface.call("jsFunction", "hello world");
}
test_mc.addEventListener("click", test_fnc);
JS:
<script type="text/javascript">     
    function jsFunction(words) {
        alert(words); // "hello world";
    }
    $(document).ready(function() {
        // not from here
    });
</script>