home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / Beez.swf / scripts / game / controller / EndGameCommand.as next >
Encoding:
Text File  |  2008-09-03  |  977 b   |  30 lines

  1. package game.controller
  2. {
  3.    import game.view.AppMediator;
  4.    import game.view.EndGameMediator;
  5.    import game.view.components.EndGameView;
  6.    import org.puremvc.as3.interfaces.ICommand;
  7.    import org.puremvc.as3.interfaces.INotification;
  8.    import org.puremvc.as3.patterns.command.SimpleCommand;
  9.    
  10.    public class EndGameCommand extends SimpleCommand implements ICommand
  11.    {
  12.        
  13.       
  14.       public function EndGameCommand()
  15.       {
  16.          super();
  17.       }
  18.       
  19.       override public function execute(note:INotification) : void
  20.       {
  21.          var appMed:AppMediator = facade.retrieveMediator(AppMediator.NAME) as AppMediator;
  22.          var endGameView:EndGameView = new EndGameView();
  23.          appMed.getViewContainer().addChild(endGameView);
  24.          var endGameMed:EndGameMediator = new EndGameMediator(endGameView);
  25.          endGameMed.initialize(note.getBody() as int);
  26.          facade.registerMediator(endGameMed);
  27.       }
  28.    }
  29. }
  30.