Search code examples
javascriptapache-flexexternalinterfacelisten

Flex 4 listen for JavaScript


I am currently using ExternalInterface to call JS functions from Flex.

Is it possible to do the same the other way around: have Flex execute a function when a certain trigger is executed in JS?

I want to have a Flash app with buttons in HTML that when pressed call functions inside the Flex app.

Thank you.


Solution

  • ExternalInterface.addCallback() is a way. Here is an example.http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7e92.html, it call flex function by onchange event, try onclick event of your button instead.