11 Replies Latest reply on Jun 19, 2009 11:27 AM by gsushma

    FABridge / ExternalInterface Does not work on IE

    Yankee_Shes
      Hello,

      I'm using Flex to Ajax Bridge (FABridge) generated from the Flex Builder to Invoke Functions inside Flex through JavaScript that is on my HTML Page. I have issues with IE(6,7 & 8) , It does not work. I tried using ExternalInterface API too. I still have the same Issue, Can you please let me know if anyone has come across this issue & if there is any workaround for IE. THIS ISSUE IS CRITICAL FOR OUR APPLICATION. PLEASE HELP !! :(

      Cheers,
      Shesh
        • 1. Re: FABridge / ExternalInterface Does not work on IE
          _Natasha_ Level 4
          If you try it in html page on your local disk, then it's possible to be security error. Learn about security in docs
          for example here
          • 2. Re: FABridge / ExternalInterface Does not work on IE
            Yankes_Shes
            Hi Natasha,

            Thanks for your reply. I'm accessing my application from tomcat server. So It's not the issue of Security.

            My Issue is Flex to Ajax Bridge (FABridge) / ExternalInterface API does not work on IE, I have checked it on IE 6, 7 & 8 !!

            PLS HELP !!!! :(
            • 3. Re: FABridge / ExternalInterface Does not work on IE
              _Natasha_ Level 4
              Hello.

              Can you run example from sdk_dir\frameworks\javascript\fabridge ?
              I try it on IE 8 - all is ok, but it's needed to change SimpleSample.html as it's written here

              If it works, it's needed some more information about your problem.
              • 4. Re: FABridge / ExternalInterface Does not work on IE
                Yankes_Shes Level 1
                When I run SimpleSample.html on IE 7, It doesn't show up anything on the Flex side ... I see JavaScript Error : "FABridge is Undefined".
                & FABridgeSample.html gives JavaScript Error : "FABridge.example is null or not an object".

                When you try to run the SimpleSample.html on FireFox, What is the expected behaviour ? I don't see any Flash thing there ? I just see some piece of code displayed when I click on the radio button...

                I will try to check it on IE 8 too.

                Thanks,
                Shesh
                • 5. Re: FABridge / ExternalInterface Does not work on IE
                  _Natasha_ Level 4
                  Hello Shesh.

                  You are absolutely right that it's a javascript error is occured for this example. But in docs there is a comment about this problem.
                  "In the lastest download (flex_sdk_3.zip for Windows), the flex ajax bridge sample "SimpleSample.html" located in "frameworks/javascript/fabridge/samples/" references the wrong '.js' file. It currently references 'src/bridge/FABridge.js' but the file is actually located in 'srcview/source/fabridge/javascript/FABridge.js'. You just need to alter the html file to get the script to work."

                  It's really work after this.
                  • 6. Re: FABridge / ExternalInterface Does not work on IE
                    jcastelain Level 1
                    Hello Yanlee,

                    I have used the Flex Ajax Bridge, without any porblem with IE7

                    Could you tell me what isn't working with ExternalInterface or FAB for you?
                    • 7. Re: FABridge / ExternalInterface Does not work on IE
                      Yankes_Shes Level 1
                      Hello Natasha,

                      I still get "FABridge.example is null or not an object" Javascript error on IE 7.


                      • 8. Re: FABridge / ExternalInterface Does not work on IE
                        Yankes_Shes Level 1
                        Hello Jaste,

                        I'm really interested to see how you made FABridge to work onIE 7. It will be a great help. Here is what I'm trying to do.

                        I have a sample MXML Application Test.mxml created in Flex builder 3.0 , I have a public method in MXML Under mx:Script CDATA .Inside this function I'm calling an Alert to check if this method has been called from Javascript.

                        I created FlexBridge from FlexBuilder & I copied FABridge.js, Test.js, Test.swf files under a directory in my Tomcat application server. Under the same folder I have a HTML Page where I have embedded the Test,swf.

                        In HTML I have a javascript that I have included FABridge.js & Test.js & JavaScript Function as shown below: I have a button on click of this button I'm calling a function in Javascript to invoke method in MXML. This works in FireFox, Safari . When I run the same on IE 6,7 & 8, I get only the first alert after this nothing happens.

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns=" http://www.w3.org/1999/xhtml">
                        <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                        <title>Untitled Document</title>
                        </head>

                        <body>
                        <script type="text/javascript" src="FABridge.js"></script>
                        <script type="text/javascript" src="Test.js"></script>
                        <input type="button" name="ClickMe" onClick="JavaScript:accessFlex()" value="ClickMe" />
                        <script type="text/javascript">

                        //accessFlex();

                        function accessFlex() {
                        alert('Inside Access Flex Function');
                        var initCallback = function() {
                        try {
                        alert(FABridge);
                        var root = FABridge.flash.root();
                        alert(root.getWidth());
                        root.myFunc();
                        }
                        catch(err) {
                        alert(err);
                        }
                        }

                        FABridge.addInitializationCallback("flash",initCallback);
                        }

                        </script>

                        <object>
                        <embed src="Test.swf"/>
                        </object>

                        </body>
                        </html>

                        I hope you got what I'm trying to do. I'm curios to see if I can make this to work on IE. Waiting for your reply at the earliest possible.

                        • 9. Re: FABridge / ExternalInterface Does not work on IE
                          Yankes_Shes Level 1
                          Hello Natasha / Jaste,

                          I got the samples working !!! I got the samples from the net & it works fine.

                          However the samples that I have on my Flex SDK 3.2.0, doesn't work !

                          Neverthless, I got my code working for IE too. I missed out <param name="flashvars" value="bridgeName=flash"/> which should be included to refer the bridgeName.

                          I have tested on IE 6 & 7.

                          Thanks a lot for your help. I appreciate it greatly.

                          Cheers,
                          Shesh
                          • 10. Re: FABridge / ExternalInterface Does not work on IE
                            tomArrow
                            I'm having an issue with the FABridge.js from SDK 3.2.0 and IE8. This works in Firefox 3.1b3 and Safari. To cover Yankes's error, I did have the flashvars bridgeName value set. Any ideas?

                            The error from IE is:
                            Message: Object doesn't support this property or method
                            Line: 219
                            Char: 9
                            Code: 0
                            URI: http://localhost:8080/mtk/view/includes/FABridge.js

                            my usage of it is:
                            if (FABridge.flex) {
                            var flexApp = FABridge.flex.root();
                            var proceed = true;
                            if (flexApp.getStateHandler().getIsDirty()) {
                            proceed = confirm("You have unsaved changes. Press OK to discard all unsaved changes")
                            }
                            }

                            • 11. Re: FABridge / ExternalInterface Does not work on IE
                              gsushma

                              Hi tomArrow,

                               

                              Were you able to figure out what the problem was? I'm facing a similar issue.

                               

                              Any help is highly appreciated.

                               

                              Thanks,

                              Sushma.