udp-flashlc-bridge

udp-flashlc-bridge

Sep 23, 2009
Version 1.0b1
MacOS 10.5+, Windows XP/Vista/7, Linux

Download Version History

udp-flashlc-bridge is a free, open-source bridge application between UDP network traffic and a Flash LocalConnection.

Running from the command-line, udp-flashlc-bridge listens on a given UDP port and sends any packets that it received through a Flash LocalConnection with a given name and dispatch method, providing a highly performant way of accessing UDP data from within Flash. This is useful because Flash does not provide any builtin means to process arbitrary UDP input.

It has originally been designed to serve as a bridge between TUIO tracking data and Flash, but since it is not concerned at all with the format of the packets that it receives, it can be used to funnel any sort of UDP traffic into a Flash application or SWF file.

Requirements

Binaries for Intel Macs running 10.5 or later as well as Windows PCs running XP, Vista or 7 are provided in the download. Users on PowerPC Macs or Linux systems can use the supplied makefile to build their own binaries from the source. Flash Player 10 or later must be used to run client SWFs.

Features

Usage

In your Flash application, connect to a LocalConnection and provide a dispatch method that accepts a byte array. This array will hold the payload of a UDP packet when it is invoked.

public function init():void {
	connection:LocalConnection = new LocalConnection();
	connection.connect("_MyConnection");	
	connection.allowDomain('*');
	connection.client = this;
}

public function dispatchPacket(data:Object):void {
	if (data is ByteArray) {
		var bytes:ByteArray = data as ByteArray;
		trace("received " + bytes.length + " bytes.");
	}
}

Go to the command-line and start udp-flashlc-bridge, supplying the name of your LocalConnection and the name of the dispatch method with the -c and -m parameters (the default connection and dispatch name refer to the handling of TUIO/OSC data with the official Flash bindings).

gck@ramanujan$ ./udp-flashlc-bridge -c _MyConnection -m dispatchPacket
Listening for UDP at port 3333...
Serving Flash via LocalConnection at _MyConnection:dispatchPacket

For a full listing of supported command line parameters, start udp-flashlc-bridge with the -h flag.

Release Notes

Release notes for official releases are available here.

Links

Below are a couple of related links for further reading.

Introductory Video