Orbit is a development framework to create real-time multi-user multi-device applications. Applications can be written with a platform-agnostic API which fits perfectly in your development environment.

Orbit is network-based, so you don’t necessarily need an internet connection, but you do need a way to reach your other devices though the IP protocol. Though it’s highly preferable that you can connect directly (like multiple computers on the same LAN), it was thought to allow complex network configurations. Each user that appears on the network is an object which emits/receives messages, following a classic Observer pattern.


package aerys.helloworld
    import aerys.orbit.Node;
    import aerys.orbit.Session;
    import aerys.orbit.log.ConsoleLogger;
    import aerys.orbit.log.LogLevel;
    import aerys.orbit.log.Logger;
    import aerys.orbit.scheme.AttachedMessage;

    import flash.display.Sprite;
    import flash.events.Event;

    public class HelloFlashClient extends Sprite
        // Create a node, associated with our generated scheme.
        private var _node       : Node      = new Node(new HelloScheme);

        public function HelloFlashClient()
            addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);

        public function addedToStageHandler(event : Event) : void
            // Set up the default logger to standard output.
            Logger.backend = new ConsoleLogger();
            // Accept any log message. Verbose.
            Logger.level = LogLevel.ALL;

            // Add an endpoint. By default, a node has none.

            // Create a session, to dispatch the messages.
            var session : Session = _node.create();

            // Add a handler to detect when the session is attached to the remote node.
            session.addEventListener(AttachedMessage.ATTACHED, attachedHandler);

            // Attach the session. Stops on the first successful endpoint. Asynchronous.

            // Mark the node as ready.

        // Define the handler, ActionScript-style.
        public function attachedHandler(message : AttachedMessage) : void
            // Retrieve the Session. There are three ways of doing it:
            //  - Session.current
            //  - (message.target as Session)
            //  - Keep the result of _node.create() in an instance variable 
            var session : Session = Session.current;

            // Dispatch a custom message to the server.
            session.dispatchEvent(new HelloMessage("Hey!"));
Multiplayer . URL.