This content has been marked as final.
Show 3 replies
-
1. Re: How to trigger a AS function via JS?
kglad May 6, 2014 9:49 AM (in response to Ron Colmen)use:
AS:
import flash.external.*;ExternalInterface.addCallback("jsCallF",null,test1);
function test1(s:String) {
//do something with s
}JS:
<script type="text/javascript">function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName]
}
else {
return document[movieName]
}
}
window.onbeforeunload = function(){
thisMovie("your_swfs_embed_tag_name").jsCallF('text here');
};
</script>and you'll need to use embedding code compatible with the externalinterface class. swfobject works and there's code shown in the adobe help files that also works.
and you'll need to use the correct name in place of your_swfs_embed_tag_name.
-
2. Re: How to trigger a AS function via JS?
Ron Colmen May 7, 2014 7:05 PM (in response to kglad)you're amazing... thanks!
-
3. Re: How to trigger a AS function via JS?
kglad May 7, 2014 9:35 PM (in response to Ron Colmen)you're welcome.



