12/11/2007

gwt-fabridge 1.1.1 released

You can download the new version here.

This release integrates new versions of gwt2swf and the fabridge. Rafal Malinowski has now updated gwt2swf with the changes necessary for gwt-fabridge. You can use his original library directly with gwt-fabridge.

gwt-fabridge itself has become more stable and convenient. You can now use addCompleteListener, addChangeListener, addClickListener and addOpenListener instead of the generic addEventListener. More importantly you can use JSNIUtils.convertArray(JavaScriptObject) to convert Javascript arrays to a Java ArrayList (this is convenient for Actionscript methods that return arrays).

The new version of fabridge from Devin Garner "allows access to the toString, statics, constants" (more info here). For now I have only integrated his first version, not his second. The latter did not work with my createASObject method. Thanks to Vasile Dumitrascu for the tip!

There still is no official version of FABridge, which fixes this problem. You have to change your version of fabridge.js accordingly or you have to use the version that comes with gwt-fabridge.

For code examples and more tips how to use the library, please read the previous post for 1.0

10 Kommentare:

Max Payne hat gesagt…

Hi can you provide the mxml of the example you have given in the gwt-fabridge
plz it is urgent

Christian Voigt hat gesagt…

Hi!
I have used the example that comes with the Flex 3 SDK. After installation you will find it in the following directory on your computer: [your_install_dir]/Adobe_Flex_Builder_Linux
/sdks/3.0.0/frameworks/javascript/fabridge/samples/app.xml

But you can also go directly to Adobes SVN:
app.mxml

I hope this helps,
christian

Max Payne hat gesagt…

hi thanks for the reply thank you
but there is one more problem i am using your jar with gwt-ext.When i directly add SWFABridgeWidget directly to the root panel then every thing works fine but when i add it to some contentPanel and add that content panel to the RootPanel then it gives this error

[WARN] Exception thrown into JavaScript
com.google.gwt.core.client.JavaScriptException: JavaScript Error exception: null
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:481)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeHandle(ModuleSpace.java:225)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeHandle(JavaScriptHost.java:89)
at org.argunet.gwt.fabridge.client.SWFABridgeWidget.getBridgeRoot(SWFABridgeWidget.java:89)
at org.argunet.gwt.fabridge.client.SWFABridgeWidget.root(SWFABridgeWidget.java:79)
at com.lehman.trc.gui.client.tradebrowser.TradeBrowserView.onInitialization(TradeBrowserView.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)

i think in this case it is not able to create the bridge
this is my code

SWFParams params = new SWFParams("flex/TradeBrowserold.swf", "100%","100%");
// set bridge name for FABridge
params.addVar("bridgeName", "example");
swfWidget = new SWFABridgeWidget(params);
// add initialization listener
swfWidget.addInitializationListener(TradeBrowserView.this);
contentPanel.add(swfWidget);
//show swf movie
swfWidget.show();

and
public void onInitialization()
{
BridgeParameter params = new BridgeParameter();
params.addParameter("name");
BridgeObject b=swfWidget.root();-------error is at this point
b.invokeMethod("initFlex",params.getParameter());
//swfWidget.root().invokeMethod("initFlex",params.getParameter());
}

is there any way to solve this problem thank you

i think full comment is not visible so i have uploaded it in txt plz have a look file

Christian Voigt hat gesagt…

strange error. maybe this has something to do with gwt-ext? Have you tried to use a GWT Panel?

I am using a SimplePanel in my project with almost the same code.

Have you tried to use another bridgeName (i.e. "example2")? The fabridge looks for an element with this id in your html. If there is more than one element with this id, it could cause the problem...

glidealong hat gesagt…
Dieser Kommentar wurde vom Autor entfernt.
glidealong hat gesagt…

Hi , I appreciate your efforts and the library provided. I am trying to use your library to embed flash components onto GWT TabPanel. That's fine, but I want to set some data into these flash components. I am trying to use both
swfWidget.root().setProperty() method and swfWidget.root().invokeMethod() functionality provided with the library, but I keep getting this error.
Error: $wnd.FABridge[b] has no properties
Source File: http://localhost/GWT/www/com.gwt.prototype.GWTFlex/BD27166EFD2E82A8BBF03BEDC62B715A.cache.html
Line: 624
It would be really helpful if you can give a clue.

Thanks in advance.

Unknown hat gesagt…

Hi!

I have a ChartItemEvent in flex. I have already added a listener in the GWT code which intercepts the event.

I want to fetch the following value from the event:
"chartItemEvent.hitData.item"

How do I do it?

Thanks in advance

Rashmi

Christian Voigt hat gesagt…

cannot try this at the moment, but this should work:
chartItemEvent.getProperty("hitData").getProperty("item").getContent();

please note that there are sometimes problems if you try to get properties from within an event listener, because fabridge does not allow "recursive calls".

This is not a problem of gwt-fabridge but of fabridge itself. You can avoid these problems by using a timer to wait for some milliseconds.

Unknown hat gesagt…

Hi Christian,
first of all thank you for a great library. Are you planning to support the new gwt2swf (v 0.6)? It has some nice new features but unfortunately is not working with current gwt-fabridge.

Christian Voigt hat gesagt…

Thank you yann! I will update the library as soon as I can. I had not checked for gwt2swf updates for a while...