Calling flash function from javascript using the swfobject doesn't seem to work (though allowscriptaccess param set to always).

A setCagegory method was added to the flash file. This function should be called from the javascript code (in callExternalInterface() function).
Unfortunately this doesn't seem to work.
Below are the relvant code extracts.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>flash experiment    </title>
      <script type="text/javascript" src="http://localhost/moov/js/swfobject.js"></script>        
      <script type="text/javascript">  
              var flashvars = {};
              var params = {
                allowscriptaccess : "always"
              var attributes = {};    
            swfobject.embedSWF("http://localhost/moov/app_files/moovFlash.swf", "movieFlash", "914", "426", "9.0.0", false, flashvars, params, attributes);
            function callExternalInterface() 
                alert('in callExternalInterface');          
            function thisMovie(movieName) 
                if (navigator.appName.indexOf("Microsoft") != -1) 
                    return window[movieName]
                    return document[movieName]
  <body onLoad="callExternalInterface()" >       
    <div id="movieFlash">
flash action script code :

import flash.external.*;

var currentCategory = 1;

var instance:Object = null;
var wasSuccessfulPlay:Boolean = ExternalInterface.addCallback("set_category",instance, set_category);
function set_category(category_id:String):Void
    currentCategory = category_id;