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...
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:
on (press) {
import flash.external.ExternalInterface;
ExternalInterface.call("test");
trace("Foo");
}
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...
<script language="javascript" type="text/javascript">
function test() {
alert("Hey");
}
</script>
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.
Anyone got any ideas?
test()defined above the Flash object in your page? - Matt Ball