1 Reply Latest reply on Aug 29, 2006 7:42 PM by Pavel_Vasev

    How to tell in JavaScript when Flash is loaded

      I'm trying to set up listeners in javascript on a Flex DataGrid to tell when its cells are being clicked or focused on. However, when I put something in javascript to execute right away or even onload the Flash .swf movie hasn't loaded yet and I get a null for FABridge.flash. Is there a way to tell when its loaded? I tried putting a while (FABridge.flash == null) loop and that just hung the page. Ideas?
        • 1. Re: How to tell in JavaScript when Flash is loaded
          Pavel_Vasev
          I faced the same problem and found a solution. See example:

          <script>
          <!--
          var minitCallback = function()
          {

          var dataHere = function()
          {
          <% if printing %>
          window.print();
          <% end %>
          }

          var flexApp = FABridge.flash.root();
          flexApp.addEventListener("dataIsHere", dataHere );
          }
          FABridge.addInitializationCallback("flash",minitCallback);

          </script>