Below is a quick class that I wrote this morning for managing popup windows in mxml / Flex 1.5. It is an all static class therefor it is easily managed. All that is required is that you pass two arguments to the createPopUp method. the first argument is the scope of which the popup need be created and the second is an mxml component which should be instantiated in the popup window.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import mx.managers.PopUpManager; class PopUpWindowHandler { public static var popup:MovieClip; public static function createPopUp(target:MovieClip, classObject:Object):Void { if ( popup == null ) { popup = PopUpManager.createPopUp(target, classObject, false, {}); popup.centerPopUp( scope) ; } } public static function close():Void { popup.closeWindow(); popup = null; } } |
{Sorry, Comments are currently Closed! }