Flash

Flash / ActionScript client for Stomp

UPDATE: an update to the STOMP AS3 client that works with latest versions of ActionScript 3 and Flex is now available.  The new client implements most (if not all) of the STOMP protocol.  You can download the binary and the source here.  A couple tutorials on how to use this client with ActiveMQ (and ActiveMessaging) are availabe here.


This page describes the Flash client for Stomp.

To get the source, refer to "Developer SVN access" and check out the source anonymously.

 This client package needs ActionScript 3. From a users perspective that means Flash Player 9.x (which most of us have these days), from a developers perspective that means:

  • Flash 9 Developer Alpha (the full release due April 2007) (Commercial)
  • Flex 2 Builder (Commercial)
  • Flex 2 SDK (Free here)

 There is nothing clever going on with this client - since the inclusion of Socket classes inside AS (and later, the XMLSocket which this package uses), Server to Client push with Flash has been easy.

 To set up the connection and subscriptions:

public var socket:STOMPClient = new STOMPClient();	//Create the STOMP Client
socket.connect( "localhost", 61613 ); //Connect
socket.subscribe( new Subscription("/queue/myfirstq") ); 	//Subscribe to a queue
socket.subscribe( new Subscription("/topic/myfirsttopic") ); 	 //and a Topic

 To handle the messages within your code:
myClassThatRecievesTheEvent.addEventListener(STOMPEvent.SubscribedEvent, myHandlerFunction);

function myHandlerFunction(evt:STOMPEvent):void {
    trace("Recieved:"+evt);
}



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 22, 2007

    Skip Hanson says:

    Thank you for this information. Could you be more specific as to where to get th...

    Thank you for this information. Could you be more specific as to where to get the source ? I am new around here and can't find where "Developer SVN Access" is. Thanks.

  2. Sep 05, 2007

    Vic Cekvenich says:

    Nice project!  I get error using source: http://www.nabble.com/Flex-er...

    Nice project!

     I get error using source: http://www.nabble.com/Flex-errors-tf4387046.html

    hint?