Search code examples
jqueryflashactionscriptactionscript-2externalinterface

AS2 (not AS3) button that triggers jquery click()


I'm really struggling with this. I have a flash demo built in AS2 (not AS3). I want to click on a button and execute a jQUERY click() event to hide/show a DIV that will be shown as "modal" on top of FLASH file.

But I cannot even get an ALERT box to work...

Actionscript

on(press) { import flash.external.*; ExternalInterface.call('function(){ alert("test"); }'); }

Any ideas on what am I doing wrong?


Solution

  • Nevermind... I fixed the issue myself. To make it work you have to make sure that access to script is ALWAYS allowed. The following line is inside the tag of the FLASH:

    <param name="allowScriptAccess" value="always" />