title: Calling JS from a flash video
body: <p>I need to create a really basic flash video (actionscript 2) where I click on a bit of text which will call a javascript function. I'm really new to actionscript so please forgive me if this is a trivial question...</p>
  
  <p>I have created a flash video which has a bit of text I converted to a button symbol. I then opened the "Actions" tab and added:</p>
  
  <pre><code>on (press) {
      import flash.external.ExternalInterface;
      ExternalInterface.call("test");
      trace("Foo");
  }
  </code></pre>
  
  <p>Which when I debug will print "Foo" to the output window. However when I put this flash video on a page with the following js in the header nothing happens...</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      function test() {
          alert("Hey");
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I thought that it might be something to do with ExternalInterface.call so I tried getUrl("javascript:test()") which popped up a security warning (so the pressed event must be firing) but then did nothing when I ok'd the warning.</p>
  
  <p>Anyone got any ideas?</p>