0 Replies Latest reply on Apr 16, 2014 7:40 AM by HaoHuaHe

    Worker Question

    HaoHuaHe Level 1

      Hi, I can't get any traces from my worker swf. I have a main swf and a worker swf. The traces in the worker's constructor and the message handler when receiving messages are not showing. In the main swf, the event handler for worker running works and the listWorkers function shows there are workers. Heres the code for the worker:

       

      public function Worker()

                          {

        trace("BackWorker");

                                    bm = Worker.current.getSharedProperty("btm");

                                    mb = Worker.current.getSharedProperty("mtb");

        trace("BackWorker " + mb);

                                    mb.addEventListener(Event.CHANNEL_MESSAGE, onMainToBack);

                          }

       

                          protected function onMainToBack(event:Event):void

                          {

        trace("onMainToBack");

                                    if(mb.messageAvailable)

                                    {

                                              var header:String = bm.receive();

                                              if(header == "HELLO")

                                              {

                                                        trace("WORLD");

                                                        bm.send("WORLD");

                                              }

                                    }

                          }

       

      none of the traces from the worker swf is showing and I don't get a reply from the bm.send() function.

       

      Anyone know why?