Skip to content

Instantly share code, notes, and snippets.

@cpreston
Created April 11, 2014 17:55
Show Gist options
  • Save cpreston/10487991 to your computer and use it in GitHub Desktop.
Save cpreston/10487991 to your computer and use it in GitHub Desktop.
Call action script from javascript
if(ExternalInterface.available)
{
ExternalInterface.addCallback("callFlashFromJS", addBooks);
}
<div id="myForm">
<input name="inputTextField" id="inputTextField" type="text" value="0">
<form name="form">
<input type="button" onclick="callFlash()" value="Call Flash" />
</form>
<script type="text/javascript">
function callFlash()
{
var inputTextFieldValue = document.getElementById('inputTextField').value;
//alert(getSWF('${application}') + inputTextFieldValue);
getSWF('${application}').callFlashFromJS(inputTextFieldValue);
}
</script>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment