Professional Web Applications Themes

How to Minimize a popup window? - Macromedia Flex General Discussion

We are using title window as a pop-up. The title window has a property called closeButton which when set to true displays a close button on the top right hand corner of the title window. Likewise, We also need minimizeButton property which can minimise the window. Is there any such component like title window which has this property of minimise this window or any other workaround.[b]Text...

  1. #1

    Default How to Minimize a popup window?

    We are using title window as a pop-up.

    The title window has a property called closeButton which when set to true
    displays a close button on the top right hand corner of the title window.
    Likewise, We also need minimizeButton property which can minimise the window.
    Is there any such component like title window which has this property of
    minimise this window or any other workaround.[b]Text

    Mihir@adobeCoE Guest

  2. #2

    Default How to Minimize a popup window?

    package Thava

    {

    import flash.events.Event;
    import flash.events.MouseEvent;

    import mx.containers.Panel;
    import mx.controls.Button;
    import mx.effects.Resize;


    public class MinMaxPanel extends Panel

    {

    private var minBtn:Button = new Button();

    [Embed(source="img/minimize.jpg")]
    [Bindable]
    public var minijpg:Class;

    private var maxBtn:Button =new Button();
    private var effResize:Resize = new Resize();



    private var previousHeight:int = 30;

    private var h1:int = 394;

    // public var minMaxButton:MinMaxButton ;

    public function MinMaxPanel()

    {

    super();

    minBtn.addEventListener(MouseEvent.CLICK, minimisePanel);
    maxBtn.addEventListener(MouseEvent.CLICK, maxmisePanel);

    }

    // add the minimize and maximize buttons to the Titlebar of TitleWindow

    override protected function createChildren():void{

    super.createChildren();
    super.titleBar.addChild(minBtn);
    super.titleBar.addChild(maxBtn);
    super.titleBar.addEventListener(MouseEvent.MOUSE_D OWN,handleDown);
    super.titleBar.addEventListener(MouseEvent.MOUSE_U P,handleUp);


    }

    // handleDown and handleUp functions used for dragging the panel container

    private function minimisePanel(e:MouseEvent):void{

    effResize.heightTo = previousHeight;


    effResize.play([this]);
    }




    private function maxmisePanel(e:MouseEvent):void{

    effResize.heightTo =h1 ;

    effResize.play([this]);

    }

    private function handleDown(e:Event):void{
    this.startDrag();

    }
    private function handleUp(e:Event):void{
    this.stopDrag();

    }

    // The below code is for placing the button in the top corner of titleWindow..
    // Decide the position of button by giving height,width....

    override protected function updateDisplayList(w:Number, h:Number):void{

    super.updateDisplayList(w,h);

    minBtn.x = super.titleBar.width - 80;

    minBtn.y = 10;

    minBtn.width = 20;

    minBtn.height = 20;

    maxBtn.x = super.titleBar.width - 50;

    maxBtn.y = 10;

    maxBtn.width = 20;

    maxBtn.height = 20;

    }

    }
    }
    RevThava Guest

Similar Threads

  1. Setting a popup window's base target to caller window?
    By saf_123 in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 6th, 11:01 AM
  2. Popup menu on popup window
    By Peepio in forum Macromedia Flex General Discussion
    Replies: 5
    Last Post: July 5th, 03:26 PM
  3. minimize flash window
    By Michael Long in forum Macromedia Flash
    Replies: 0
    Last Post: April 28th, 04:43 PM
  4. Double clicking window bar doesn't minimize
    By Christopher_Gentry@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 3
    Last Post: February 20th, 04:42 PM
  5. can a popup window return data to parent window?
    By nadia in forum PHP Development
    Replies: 3
    Last Post: September 25th, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139