1 Reply Latest reply on Oct 9, 2009 3:13 AM by sreedharvaddi

    External Interface not Working in IE

    sreedharvaddi

      i am trying to pass the values from javascript to flex. my code works perfectly in all the browsers except IE ( tried in 6,7 and 8 versions).

      please suggest the way to do it.

       

      Here is my flex(AS) code

       

      private function oninit():void{
                      if(ExternalInterface.available){
                          ExternalInterface.addCallback("getBaseUrl",receiveFromScript);
                          ExternalInterface.call("getBaseUrl",null);
                         }
                      else{
                          Alert.show("call failed");
                         }
                  }
      private function receiveFromScript(val:String):void{
                                   Alert.show(val);
                          }
      

       

      and this is my html Code

       

      <SCRIPT LANGUAGE="JavaScript">
      function thisMovie(movieName)
       {
         if (navigator.appName.indexOf("Microsoft") != -1)
             {
              return window[movieName];
             }
         else 
             {
              return document[movieName];
             }
       }
      function getBaseUrl()
      {
           thisMovie("myApp").getBaseUrl("from JS");
      }
      </SCRIPT>
      
      <object id="myApp"  width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
      <param name="movie" value="DocLifeCyle.swf"/>
      <param name="quality" value="high" />
      <param name="allowScriptAccess" value="always" />
      <embed src="/myApp.swf"  width="100%"  height="100%" name="myApp"  align="middle" play="true" loop="false" allowScriptAccess="always" type="application/x-shockwave-flash"     pluginspage="http://www.adobe.com/go/getflashplayer">
      </embed>
      </object>