The Space For App Developers

Beyond Plain Old HTML Objects

Archive for June, 2010

Flerry 1.1.0 released with a two-way Flex-Java communication

with 10 comments

I would like to proudly announce that Flerry 1.1.0 was released! For those of you that don’t know what is Flerry, it’s a Flex-Java bridge for Adobe AIR 2.0. This new release brings possibility to call/initiate communication from Java to Flex/AS3 code. This functionality was solely developed by Jhonny Everson, big kudos to Jhonny!!! I love when open source really works and community contributes their work, with that said I encourage any of you that use Flerry to commit to the project ;)

You can grab latest FB4 project with Flerry and demo app from here.

Usage is really simple:

First create instance of NativeObject either in MXML or AS3 (binPath is path to jar file with compiled Java source classes):

<flerry:NativeObject id="nativeObject" singleton="true" 
binPath="./jars/flerry-demo.jar"  source="net.riaspace.flerrydemo.MyJavaObject" />

Next subscribe to messages sent from Java side, “sendMsg” parameter defines message identifier:

// Subscribe to receive remote messages.
nativeObject.subscribe("sendMsg", messageHandler);

On the Java side you have static method sendMessage on NativeObject class with message parameter and again message identifier:

NativeObject.sendMessage(map, "sendMsg");

Written by Piotr Walczyszyn

June 30th, 2010 at 10:30 am

Posted in Releases

Tagged with , ,