PureMVC StartupCommand Class Template


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2. * Base PureMVC Project
  3. */
  4. package controller
  5. {
  6. import flash.display.Stage;
  7. import org.puremvc.as3.interfaces.ICommand;
  8. import org.puremvc.as3.interfaces.INotification;
  9. import org.puremvc.as3.patterns.command.SimpleCommand;
  10.  
  11. import ApplicationFacade;
  12. import view.StageMediator;
  13.  
  14.  
  15. /**
  16. * Simple StartupCommand for PureMVC Structured Project
  17. */
  18. public class StartupCommand extends SimpleCommand implements ICommand
  19. {
  20. override public function execute( note:INotification ) : void
  21. {
  22. /**
  23. * Get the View Components for the Mediators from the app,
  24. * which passed a reference to itself on the notification.
  25. */
  26. var stage:Stage = note.getBody() as Stage;
  27.  
  28. facade.registerMediator( new StageMediator( stage ) );
  29. }
  30. }
  31. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.