Posted By

wintondeshong on 05/02/08


Tagged

textmate actionscript3 PureMVC SimpleCommand


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

n00ge


PureMVC StartupCommand Class Template


 / Published in: Other
 

  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  

You need to login to post a comment.