title: IE SCRIPT16389 Error with Flash ExternalInterface Callback and JQuery Slider
body: <p>I'm having a really odd issue with Internet Explorer, on my website I'm using the JQuery AnythingSlider plugin to display some videos. Whenever someone slides to the next video, I have a flash call back:</p>
  
  <pre><code>import flash.external.ExternalInterface;
  ExternalInterface.addCallback("movie_pause",player.pause);
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>var obj = swfobject.getObjectById($(this).attr('id'));
  if(obj){
      obj.movie_pause(); //This is where the error takes place
  }
  </code></pre>
  
  <p>Now the weird thing is, when the page is first loaded, everything runs fine. However after a refresh, or just randomly after sliding a couple of times, IE starts throwing error SCRIPT16389: Unspecified Error and points to the above line. But if I am debugging with IE, it instead points to:</p>
  
  <pre><code>function __flash_addCallback(instance, name) {
      instance[name] = function() {
          return eval(instance.CallFunction("&lt;invoke name=\""+name+"\" returntype=\"javascript\"&gt;" + __flash__argumentsToXML(arguments,0) + "&lt;/invoke&gt;"));
      }
  }
  </code></pre>
  
  <p>I'm embedding my videos using swfObject:</p>
  
  <pre><code>&lt;object id="testimonial_{testimonials_ID}" 
      classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="720" height="480"&gt;
      &lt;param name="movie" value="&lt;?php echo content_url();?&gt;videos/player/agflvplayer.swf"&gt;
      &lt;param name=FlashVars value="id=testimonial_{testimonials_ID}&amp;flvurl=&lt;?php 
      echo content_url();?&gt;{testimonials_url}&amp;player_skin=&lt;?php 
      echo content_url();?&gt;videos/player/SkinOverAllNoCaption.swf&amp;volume=0"&gt;
      &lt;param name="wmode" value="transparent"&gt;
      &lt;!--[if !IE]&gt;--&gt;
      &lt;object type="application/x-shockwave-flash" data="&lt;?php echo content_url();?&gt;videos/player/agflvplayer.swf" width="720" height="480"&gt;
          &lt;param name=FlashVars value="id=testimonial_{testimonials_ID}&amp;flvurl=&lt;?php 
          echo content_url();?&gt;{testimonials_url}&amp;player_skin=&lt;?php 
          echo content_url();?&gt;videos/player/SkinOverAllNoCaption.swf&amp;volume=0"&gt;
          &lt;param name="wmode" value="transparent"&gt;
          &lt;!--&lt;![endif]--&gt;
          &lt;p&gt;Alternative content&lt;/p&gt;
          &lt;!--[if !IE]&gt;--&gt;
      &lt;/object&gt;
      &lt;!--&lt;![endif]--&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>You can take a look at the issue http://people.oregonstate.edu/~egliju/agtools/welcome/test/'><a href="http://people.oregonstate.edu/~egliju/agtools/welcome/test" rel="nofollow noreferrer">http://people.oregonstate.edu/~egliju/agtools/welcome/test</a>.
  Nearest issue I could find is <a href="https://stackoverflow.com/questions/6133512/externalinterface-not-working-in-ie-after-page-refresh">ExternalInterface not working in IE after page refresh</a> but there is no answer(they just recommend using swfobject, which I am).</p>