Hi all,

I was wondering if anyone has been able to successful use SWFObject with
the Flex-Ajax Bridge (FABridge)?

The SWFObject wiki offers a modified version of FABridge.js is supposed
to resolve issues with supporting the FABridge, but I have not had any
luck with it. I have a simple Flex application with a function that
calls alert:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" width="640" height="480">
     <fab:FABridge xmlns:fab="bridge.*" />
     <mx:Script>
     <![CDATA[
         import mx.controls.Alert;
         public function test():void {
             Alert.show("You called?");
         }
     ]]>
     </mx:Script>
</mx:Application>

And here is what I have on the JavaScript side:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
     <head>
         <title>FABridge Test</title>
         <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
         <script src="bridge/FABridge.js" type="text/javascript" />
         <script src="swfobject.js" type="text/javascript" />
         <script type="text/javascript">
             swfobject.registerObject("myFlashContent", "9.0.0",
"expressInstall.swf");
         </script>
     </head>
     <body>
         <div>
             <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="640" height="480" id="myFlashContent">
                 <param name="movie" value="out.swf" />
                 <!--[if !IE]>-->
                 <object type="application/x-shockwave-flash"
data="out.swf" width="640" height="480">
                 <!--<![endif]-->
                     <a href="http://www.adobe.com/go/getflashplayer";>
                         <img
src="http://www.adobe.com/images/shared/download_buttons/get_flash_playe\
r.gif" alt="Get Adobe Flash player" />
                     </a>
                 <!--[if !IE]>-->
                 </object>
                 <!--<![endif]-->
             </object>
         </div>
         <input type="button" id="bridgeBtn" value="Talk to Flex"
click="var flexApp = FABridge.flash.root(); flexApp.test();" />
     </body>
</html>
I've tried a lot of different things with no success. Initially I
thought the problem was related to compatability issues jQuery, although
even by doing things manually It does not want to work. I also tried
manually setting the bridge to use via flashvars:

<param name="flashvars" value="bridgeName=testBridge" />
FABridge.testBridge.root();

But that did not do the trick either.

Finally, I noticed that with the above code, it seems like only one
external script, either FABridge.js or swfobject.js is loaded, depending
on which one comes first, according to Firebug. I.e. when swfobject.js
is loaded first, Firebug only sees it. When FABridge.js is loaded first,
Firebug only sees that.


Any ideas? Any advice would be greatly appreciated.

Thanks!
Keith



Reply via email to