0

I am trying to receive push data from blazeds. I found how to send push data from blazeds without any message from client in HERE. Now I don't know how to know from flex that data has been sent from server and how to receive that data . Thanks :)

Community
  • 1
  • 1
Tahlil
  • 2,680
  • 6
  • 43
  • 84

1 Answers1

0

To recieve messages from the link that you shared above there are couple of things that you need to do.

  1. You need to declare a Consumer as shown below that will consume messages from the defined channel.

  2. Note that I set the message property to an event handler show below

    private function onMsg(event:MessageEvent):void
    {
        trace("Signal Arrives : "+event.message.body);
    
        //var signal:SignalProcessor = new SignalProcessor ();
        //signal.processMessage(event.message.body);
    }
    
  3. Create a method that will be called at creationComplete of your application such as one defined below

    private function suscribeForMessages():void { //Where consumer is the Id of the Consumer mxml tag. //You need the selector only if you want your client to selectively recieve messages from //the adapter. consumer.selector = "filterID IN('"+userIdVariable+"')"; consumer.subscribe(); }

The 3 steps above should get you up and bouncing. Good luck.