title: How to call flash actionscript callback method from javascript?
body: <p>I tried to call a flash callback method from JavaScript.
  But it seems not working.
  The flash action script example code is like below [Simplified]:</p>
  
  <pre><code>import flash.events.ActivityEvent; 
  import flash.events.StatusEvent; 
  import flash.external.ExternalInterface;
  
  var test_var = ExternalInterface.addCallback("js_method_to_call", flash_method);
  
  
  function flash_method()
  {   
    return "test"; 
  }
  </code></pre>
  
  <p>The javascript example code is written below [Simplified]:</p>
  
  <pre><code> function callFlashMethod(){
     var flashFile = eval("window.document.test");
     flashFile.js_method_to_call;
   }
   function loadTest(){
     swfobject.embedSWF("test.swf", "test", "1", "1", "10.0.0", false);
   }
  
   $(document).ready(function(){
     loadTest();
     callFlashMethod();
   });
  </code></pre>
  
  <p>It is always display the error in fire bug console "flashFile.js_method_to_call is not a function".</p>