PopUpManager in PureMVC


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package com.microcore.webgame.classes
  2. {
  3. import com.microcore.webgame.ApplicationFacade;
  4.  
  5. import flash.display.Sprite;
  6.  
  7. import mx.core.Application;
  8. import mx.core.IFlexDisplayObject;
  9. import mx.managers.PopUpManager;
  10.  
  11. public class PopManager extends PopUpManager
  12. {
  13. public static function openPopUpWindow(ComponentClass:Class, MediatorClass:Class, parent:Object):void {
  14. var window:IFlexDisplayObject = PopUpManager.createPopUp(parent as prite,
  15. ComponentClass, false);
  16.  
  17. ApplicationFacade.getInstance().registerMediator(new MediatorClass(window));
  18. PopUpManager.centerPopUp(window);
  19. }
  20.  
  21. public static function closePopUpWindow(window:IFlexDisplayObject, mediatorName:String):void {
  22. PopUpManager.removePopUp(window);
  23. ApplicationFacade.getInstance().removeMediator(mediatorName);
  24. }
  25.  
  26. }
  27. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.