I am currently writing a GWT library for the integration of
FABridge. I use the simple example from Adobe as a test case,
especially the creation of a dataGrid within app.swf. Everything
works fine, as long as I do not try to set Actionscript properties.
After many hours of testing I could isolate and reproduce the
problem even without using GWT. The problem is this: Setting object
properties or calling methods that expect objects as parameters
does not work, if the FABridge is called from an iframe (everything
In Firefox "Error calling method on NPObject!" is thrown,
when the FABridge tries to set the ASProperty (line 289). In my
test case a "Too many recursion" error is thrown as well. This does
not occur, if I use GWT.
In the Adobe example a grid and two columns are created. In
the next line the columns property of the grid is set:
grid.setColumns( [col1, col2] );
To use this in an iframe, we have to call the FABridge in the
parent window, so the code looks slightly different, but the above
line still looks the same. Everything works except for this last
line, which causes Firefox to throw the Error.
Please take a look at this. I have
and one within an iframe. Both contain the same code, but only the
former does work.
Arrays which have been created in a different window object
have a different Array.prototype, so that "instanceof Array" fails
if it is called in another window where it refers to this windows
prototype. A simple but not very clean solution is to change the
line to something like this:
else if (value instanceof Array || typeof(value.sort) ==
A more complicated solution is to write a custom "typeof"
method which does not detect Arrays as "objects" but as "arrays".
Such a solution can be found on Douglas Crockfords
I have updated my
with the simple solution. It would be nice if this would be
considered in the next version of FABridge to make it "frame-safe"