1 Reply Latest reply on Oct 22, 2009 5:11 AM by Chris__L

    ExternalInterface after reload of flex not working

    Chris__L

      Hi everyone,

       

      I got a problem with the ExternalInterface in my Flex application. It "publishes" three methods via ExternalInterface.addCallback(). If I embed the Flex into my website, i can call these methods as expected.

      Now the problem: I have to load the Flex-Application in two different places on my site, depending on it's size. It's some sort of zoom. So, if the user clicks "Zoom in", the Flex-Application disappears and reappers with doubled size. This is realized via an ajax method which loads the Flex-Application into another div and clears the first.

      But after this reload, the ExternalInterface Callback are no longer callable from JavaScript. It seems like, because the Flex-Application is loaded anew, the bindings or something similar are lost. Is there any way to make javascript aware of the functions?

       

      So, in other words, I have a Flex-Application (embedded using swfobject):

      <div id="divA">
      <object style="visibility: visible;" id="ariva-ds2" data="/flash/ds-flex-test/DerivateSelector.swf"
      type="application/x-shockwave-flash" height="248" width="258"><param value="high" name="quality">
      <param value="#FFFFFF" name="bgcolor">
      <param value="transparent" name="wmode">
      <param value="sameDomain" name="allowScriptAccess">
      <param value="bgcolor=#FFFFFF&amp;search_id=502&amp;smallLayout=true" name="flashvars">
      </object>
      </div>
      When the user clicks on "Zoom in", a JavaScript method clears this div and loads the <object>-Tag into another div, let's say <div id="divB"> via AJAX.
      But after this reload, the method published by ExternalInterface are no longer callable.

      Does anyone know what goes wrong or how to "republish" these ExternalInterface Callbacks?

      Thanks in advance,
      Chris