Flex: IFrame Communication Demo

I have created a simple demo to show how to communicate with an embedded html page using FABridge.

Data is passed to the page using a Flex Event. The page registers an event handler through FABridge for the DirectionEvent. When the application creates and dispatches the event it is received along with the attached data. Note how FABridge creates the getter functions from the public member variable names ‘toValue’ and ‘fromValue’.

Data is received from the page by calling a function defined in the application from the javascript. Note that the IFrame has to be hidden when the alert box is displayed otherwise it cannot receive focus to close (try it out by commenting out the line to reset the visibility).

The demo is here. Right click to see the source code.

Full zipped project here.

The zipped project is setup to run with my local install of Apache. You will have to adjust it accordingly to get it to run under your own setup.


Comments are closed.