I have the same problem. The simple_fabrication_routing drives me crazy. I tried to find how exactly routing works. I know about respondTo<NotificationName> and that's probably why I don't understand this demo: Scenario: I launch demo load 1-2 mosules and then I press notify all modules.
Now I wanted to find out how exactly this works...
in MessageControlBarMediator I have function private function messageAllButtonListener(event:FlexEvent):void { routeNotification(FabricationRoutingDemoConstants.RECEIVE_MESSAGE, "Message From Shell"); } this is fired when I press notify all modules. ... FabricationRoutingDemoConstants.RECEIVE_MESSAGE is stated as: "receiveMessage" ... that should route note across modules and module with listener respondToReceiveMessage should be fired, but nothing like that exists.
but there is function in MessageCountMediator called:
public function respondToShellMessageCountProxy(note:INotification):void { updateShellMessageText(); } this display updated number in module ... but how this is fired?? have no idea. I tried to play with CounterProxy and this nearly bring me to maddness. I found function: public function changeCount(newCount:int):void { if (count != newCount) { setData(newCount); sendNotification(COUNT_CHANGED, newCount); } } there is sendNotification call. I noticed that when I comment this out it does not fire respondToShellMessageCountProxy in module but when I change it to ie sendNotification("blaBla", newCount); it fires anyway!? even I call just sendNotification() it still fires module respondTo.
still have no idea where is listening for respondToShellMessageCountProxy created. SimpleModuleConstants.SHELL_MESSAGE_COUNT_PROXY seems has the right syntax but can't find where is implemented as note name.
Most irritating thing about that is that I have this in front of my eyes and it works but bloodyeel can't find why:)
Any ideas??
Thanks
PS: thanks to Cliff and Darshan for creating something what brought real joy into flex programming for me
|