Chat Example 1

Ready to dive right in? Great! Let’s build this simple chat application for Adobe Flash:

What you’ll need:

  • Reactor, the Union client SDK for Adobe Flash. The latest release is available at www.unionplatform.com/releases/reactor/.
  • Access to a Union server. For quick tests like this one, use the public Union test server at tryunion.com, which runs on port 80.

All set? Let’s start coding.

The Main Class

First, create a .fla file (Flash authoring) or ActionScript project (Flex Builder), and add reactor.swc to your Library path. Next, create a main class file for the application. Union Flash clients can be written entirely on the timeline too, but this example is created with pure code. Here’s the application’s main class:

1
2
3
4
5
6
7
8
package {
  import flash.display.Sprite;

  public class UnionChat extends Sprite {
    public function UnionChat () {
    }
  }
}

Pages: 1 2 3 4 5 6 7