View Full Version : Iframe, ExternalInterface - javascript interaction

27 Nov 2013, 7:57 AM
I have an IFrame inside a tabpanel.
Inside the IFrame is an HTML page which contains a Flex application.

I have the flex app calling a javascript function inside the HTML page which works fine. But I don't want it to call a javascript function in the HTML page - I want it to call a function in a Ext JS class.

So for example I've extended the IFrame class and I wish the function to be in that, but when I try to call said function it never works (doesn't get called).

Is there a way to do this? Should I call the Ext JS function inside my extended IFrame from the HTML page inside the IFrame (if so how) or something else?


27 Nov 2013, 10:09 AM
I found a way of doing it.
Not sure how clean this method is - but it seems to work.

Inside the IFrame you have your HTML page and in that I have a script file included.
In that JS file a function gets called from the Flex application.
Inside that function I can place the following code.

var myParent = window.parent;
var controller = myParent.window.MyApp.app.getController('MyController' );

where 'MyApp is the name of my ext js application and MyController is the name of... my controller