Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: May I use routeNotification in same file(module)?  (Read 9770 times)
marks416
Sr. Member
****
Posts: 52


View Profile Email
« on: December 09, 2008, 10:28:21 »

I have the code in same file that is a mediator

static public const SEND_MESSAGE:String = "sendMessage";

routeNotification(SEND_MESSAGE, null, null, "*");

public function respondToSendMessage(note:INotification):void {
    trace("respondToSendMessage");
}

I already add the code in main page

override public function getClassByName(path:String):Class {
   return getDefinitionByName(path) as Class;   
}

But I do not know why I can not handle the notification in respondToSendMessage.
I can not trace message after I call routeNotification.

Please help me

Thanks

Mark
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #1 on: December 09, 2008, 11:25:38 »

routeNotification() is only sent out to other modules, not itself. For internal module messaging use the sendNotification() like you do with a normal PMVC app. This helps keep a clean separation between inter-module messaging and external module notifications.
« Last Edit: December 09, 2008, 11:27:32 by jasonmac » Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #2 on: December 10, 2008, 07:31:49 »

Yes this is by design. Loopback messages are dropped. Use sendNotification within a module.

peace,
darshan
Logged
Pages: [1]
Print