I want to call function from JS.
I have the following Action Script 3 code:
Package {import flash.display. *; Import flash.events *; Import Flash. System *; Import flash.external.ExternalInterface; Public Class Main Sprite Expands {Public Function Main () {ExternalInterface.addClallback ("PlaySound", PlaySound); } Public function PlaySound (): void {}}} I need to call the PlaySound () function from JavaScript. I try to do it in the following way:
function This movie (movie name) {if (navigator.appnim.exx ("microsoft")! = -1) {return window [movie name]; } And {return document [movieName]; }} Function m () {var obj = thisMovie ("main"); Obj.PlaySound (); } But there is no way in obj (PlaySound) (obj is not zero).
What's wrong?
I use this to find this movie. It seems to be more reliable:
function This movie (film name) {var movie; Try {Movie = document [movieName]; Movie = (movie == faucet)? Window [movie name]: movie; } Hold (e) {return tap; } Return movie; } I have also found that ExternalInterface does not function properly when running from the local file system. Are you trying to run it from the webserver?
It is also possible that you are looking at the situation of the race ... perhaps you are trying to call the placeholders before being registered as a callback. What if you wait a bit before calling?
Comments
Post a Comment