Hi all, first of all this is an amazing library thank you so much Darshan for your excellent work.
I'm studying http://code.google.com/p/fabrication/wiki/ReflexiveNotificationInterests but having trouble strongly typing my notifications as it won't compile. The error I get is:
"Incompatible types String and ContextMenuNotification. 'newContextMenuNotification(ContextMenuNotification.ADD_MENU)'"
Here is the Command code that the error happens in:
public class BossStartupCommand extends SimpleFabricationCommand {
registerMediator( new BossMediator( notification.getBody() ) );
// WORKS
// sendNotification( ContextMenuNotification.ADD_MENU );
// DOES NOT WORK
sendNotification( new ContextMenuNotification( ContextMenuNotification.ADD_MENU ) );
}
In my Mediator I have a respondTo function which works fine with INotification as the argument & a vanilla Notification is sent but never gets called when I swap it for my strongly typed version:
// OK - public function respondToAddMenu( args : INotification ) : void {
// NEVER CALLED - custom notification for strong typing
public function respondToAddMenu( args : ContextMenuNotification ) : void {
trace("add the menu");
}
My Notification is simple and is extending the Fabrication version, here's the code:
package {
import org.puremvc.as3.multicore.utilities.fabrication.patterns.observer.FabricationNotification;
public class ContextMenuNotification extends FabricationNotification
{
public static const ADD_MENU:String = "addMenu";
public function ContextMenuNotification (__evtType : String = "undefined")
{
super( __evtType );
}
}
}
I am using the latest versions of PureMVC Multicore, Pipes & Fabrication with Flash (Not Flex) in FDT. Can anyone point out what I'm doing wrong please? Many thanks