0 Replies Latest reply on Jan 3, 2007 1:48 PM by nitrog7

    FABridge has no properties

    nitrog7
      I noticed that when you declare a Flex Ajax Bridge object when a page first loads, it will come up with an error that says:
      FABridge.flash.root() has no properties

      Lets say you use the following on your HTML page:
      <script>
      var flexApp = FABridge.flash.root();
      flexApp.vsImages().setSelectedIndex(1);
      </script>

      The error will occur. The error will not occur if you place the above script into a function and run it from another action like a button click, like so:
      <script>
      function testFunc(){
      var flexApp = FABridge.flash.root();
      flexApp.vsImages().setSelectedIndex(1);
      }
      </script>
      <input type="button" value="Test" onClick="testFunc()"/>

      I have even tried to have Flex call a javascript function on the onComplete action but still a no go.

      Is there any way to access the Flex module from a body onLoad action (<body onload="testFunc"> or just running it straight from the script not in a function)?