Trigger Javascript from Flash with AS3

/ Published in: ActionScript 3
Save to your folder(s)

Short and sweet, add the following two lines where you want to trigger a javascript function. Just change the javascript denoted in the code by "javascriptFunction()" with whatever you want to call. Also jsut in case make sure you have the allowScriptAccess parameter set to "always".

Copy this code and paste it in your HTML
  1. var runJavascript:URLRequest = new URLRequest("javascript:javascriptFunction()");
  2. navigateToURL(runJavascript, "_top");

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.