Closed GoogleCodeExporter closed 8 years ago
Original comment by Julien.N...@gmail.com
on 14 May 2010 at 3:49
Issue 3 has been merged into this issue.
Original comment by Julien.N...@gmail.com
on 14 May 2010 at 4:33
We need to fix this before upgrading to Flex 4.
Original comment by Julien.N...@gmail.com
on 14 May 2010 at 5:04
I have found that I have to define JavaScript functions that I want to call
inside the iframe source page as
attached specifically to the document object (as this is how the
callIFrameFunction code expects to find them)
So for your example above, try changing the JS function to be declared like
this:
document.clickMe = function ()
{
alert('1');
}
Original comment by ryan2...@gmail.com
on 18 May 2010 at 3:05
OK, I added an example for callIFrameFunction():
http://code.google.com/p/flex-
iframe/source/browse/#svn/trunk/examples/CallIFrameFunction
As Ryan said, you have to declare the function this way:
document.myFunction = function ()
{
// ...
}
Original comment by Julien.N...@gmail.com
on 19 May 2010 at 8:00
I have copy the example and test it.
The parameter function doesn' work on IE8, but the other two works fine.
On Firefox works but when the alert appears, Firefox freeze.
Everything works fine on Chrome.
anyone can help me to solve it?
Original comment by end...@gmail.com
on 15 Oct 2010 at 11:50
The problem is that you are trying to target the document while your methods
are on the window object. Try this code instead:
public static var INSERT_FUNCTION_CALLIFRAMEFUNCTION:String =
"document.insertScript = function ()" +
"{ " +
"if (document." + FUNCTION_CALLIFRAMEFUNCTION + "==null)" +
"{" +
FUNCTION_CALLIFRAMEFUNCTION + " = function (iframeID, functionName, args)" +
"{" +
"var iframeRef=document.getElementById(iframeID);" +
"var iframeWin;" +
"if (iframeRef.contentWindow) {" +
"iframeWin = iframeRef.contentWindow;" +
"} else if (iframeRef.contentDocument) {" +
"iframeWin = iframeRef.contentDocument.window;" +
"} else if (iframeRef.window) {" +
"iframeWin = iframeRef.windwo;" +
"}" +
"if (iframeWin.wrappedJSObject != undefined) {" +
"iframeWin = iframeDoc.wrappedJSObject;" +
"}" +
"return iframeWin[functionName](args);" +
"}" +
"}" +
"}";
Original comment by ernesto....@gmail.com
on 13 Nov 2010 at 5:08
Last post works like a charm. Thanks! Note that the proposed code has a typo,
“iframeWin = iframeRef.windwo;”, should be “iframeWin =
iframeRef.window;”.
Cheers,
Ivan
Original comment by ivan.str...@gmail.com
on 8 Mar 2011 at 3:04
Moved to https://github.com/nicoulaj/flex-iframe/issues/35
Original comment by Julien.N...@gmail.com
on 8 May 2011 at 1:13
Hello I'm new to these iFrame API. @Ivan mentioned that @ernesto's suggestion
of using the INSERT_FUNCTION_CALLIFRAMEFUNCTION works like charm. I'm confused
though how to use it. I assume the INSERT_FUNCTION_CALLIFRAMEFUNCTION is
defined inside the Flex application, but how then do we invoke some javascript
function using that, taking into consideration that different javascript method
has different implementation or use ( Where do we insert the method
body/implementation )?
Please kindly show how we can use the INSERT_FUNCTION_CALLIFRAMEFUNCTION.
THANKS IN ADAVANCE.
Original comment by geniephu...@gmail.com
on 8 May 2011 at 2:36
As said earlier, project has been moved to
https://github.com/nicoulaj/flex-iframe. This issue is fixed in version 1.5.
Original comment by Julien.N...@gmail.com
on 15 May 2011 at 2:17
Original issue reported on code.google.com by
niketkan...@gmail.com
on 23 Feb 2010 at 7:01