title: Why does Internet Explorer fail to see my Flash ExternalInterface method in ASPX?
body: <p>I'm using Javascript to call a method on a Flash movie embedded in an ASPX page using SWFObject. It works fine in Firefox, but Internet Explorer 7 and 8 (so far) claim the object returned by <code>swfobject.getObjectById()</code> "doesn't support this property or method". I've found similar posts on this site and others, but nothing I've tried has fixed this in IE.</p>
  
  <p>ActionScript 3.0 class:</p>
  
  <pre><code>public class Player extends MovieClip {
      public function Player()
      {
          Security.allowDomain("http://localhost");
          ExternalInterface.addCallback("test", test);
      }
  
      public function test():void
      {
          debugBox.appendText("test() called successfully\n");
      }
  }
  </code></pre>
  
  <p>ASPX markup:</p>
  
  <pre><code>&lt;head runat="server"&gt;
     &lt;script type="text/javascript" src="Scripts/swfobject.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
      swfobject.registerObject("myPlayer", "9.0.0", "scripts/expressInstall.swf");
     &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div class="movie"&gt;
      &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="640" id="myPlayer"&gt;
          &lt;param name="movie" value="Player.swf" /&gt;
          &lt;param name="allowscriptaccess" value="always" /&gt;
          &lt;!--[if !IE]&gt;--&gt;
          &lt;object type="application/x-shockwave-flash" data="Player.swf" width="640" height="640"&gt;
              &lt;!--&lt;![endif]--&gt;
              &lt;a href="http://www.adobe.com/go/getflashplayer"&gt;
                  &lt;img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                      alt="Get Adobe Flash player" /&gt;
              &lt;/a&gt;
              &lt;!--[if !IE]&gt;--&gt;
          &lt;/object&gt;
          &lt;!--&lt;![endif]--&gt;
      &lt;/object&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Further along in the ASPX markup, the code that's trying to get the Flash object and call the <code>test()</code> method on it is happening in an AJAX callback from a third-party component (DevExpress ASPxHiddenField). This callback is triggered by user input after the Flash movie is loaded:</p>
  
  <pre><code>    &lt;dx:ASPxHiddenField ID="filenameHiddenField" runat="server" OnCustomCallback="filenameHiddenField_CustomCallback"
          SyncWithServer="False"&gt;
          &lt;ClientSideEvents EndCallback="function(s, e) {          
          var playerObject = swfobject.getObjectById(&amp;quot;myPlayer&amp;quot;);
      playerObject.test();
  }" /&gt;
  &lt;/dx:ASPxHiddenField&gt;
  </code></pre>
  
  <p>Internet Explorer complains about the last line in that function, "Object doesn't support this property or method".</p>
  
  <p>Thanks!</p>