-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call function from Flash #9
Comments
ReactSWF has no possibility of providing any useful unopinionated abstraction, so you have to do it the same way it's always done. Expose a globally accessible JavaScript function and provide its name through flashVars or w/e to the SWF so that it knows which function to call. So as this is nothing specific to ReactSWF I'd recommend reading up on how to use ExternalInterface in general and building on that. |
Thanks, while the ExternalInterface example show that we should put on JS func inside the head tag, we wish to put them inside our React code, thus not in the same scope and not accessible. Any idea how to access funcs that are defined inside the React code, for example inside a render func? |
You can't, it has to be a globally accessible function, either with a unique per-swf function name or a shared function with a per-swf identifying argument. |
FYI #12 (comment) |
I want call javascript function from Flash.
I use ExternalInterface in flash action as:
ExternalInterface.call("buttonClicked", buttonNumber);
but where should I put the function buttonClicked in the react and how it get the variable ButtonNumber in react?
Please explain and give us any simple example.
it will be very helpful.
many thanks
The text was updated successfully, but these errors were encountered: