6 Replies Latest reply on Nov 6, 2009 4:58 PM by artiescie

    noob: createPopUp, popup is clipped by parent??

    artiescie

      How do I avoid that clipping, I want a modal window that is bigger than the parent?

        • 1. Re: noob: createPopUp, popup is clipped by parent??
          Flex harUI Adobe Employee

          Popup shouldn't be clipped by parent unless it is bigger than the screen area.  It should be sized to its content.  Maybe you need to give it an explicit width/height.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: noob: createPopUp, popup is clipped by parent??
            artiescie Level 1

            3 files are all in same source directory

            -----

            Main.mxml

            -----

            <?xml version="1.0" encoding="utf-8"?>
                <custom:ApplicationClass xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="*">

                <mx:VBox>
                    <mx:Button height="22" id="btnRecord" label="Record" width="77" x="64" y="45"/>
                </mx:VBox>
            </custom:ApplicationClass>

             

            -----

            ApplicationClass.as

            -----

            package
            {
                import mx.core.WindowedApplication
                import flash.events.MouseEvent
                import mx.controls.Button
                import mx.events.FlexEvent
                import mx.managers.PopUpManager
                public class ApplicationClass extends WindowedApplication
                {
                    // controls
                    public var btnRecord:Button;

             

                    public function ApplicationClass ()
                    {
                        addEventListener (FlexEvent.CREATION_COMPLETE, init);
                    }
                   
                    private function init(e:FlexEvent):void
                    {
                        btnRecord.addEventListener(MouseEvent.CLICK, handleButton)
                    }

             

                            private function handleButton(e:MouseEvent):void
                    {
                        switch (e.target.label)
                        {
                            case  "Record":
                                var window:IFlexDisplayObject = PopUpManager.createPopUp(this, RecordClass, true)
                        }
                    }
                }
            }

            -----

            RecordClass.as

            -----

            package
            {
                import mx.containers.TitleWindow
                import mx.events.FlexEvent
                public class RecordClass extends TitleWindow
                {
                    public function RecordClass ()
                    {
                        addEventListener (FlexEvent.CREATION_COMPLETE, init);
                    }
                   
                    public function init(event : FlexEvent ) : void
                    {           
                        with (this) {
                            layout = "absolute";
                            width = 100
                            height = 100
                        }
                        start()
                    }       
                   
                    private function start():void
                    {
                    }
                }
            }

            ---

            Click Record, you see the small TitleWindow popup.  Drag it over the edge of parent window, it is clipped by parent window.

             

            Evidently I am overlooking some cause of that , can you help me out?

             

            tx

            artie

            • 3. Re: noob: createPopUp, popup is clipped by parent??
              Flex harUI Adobe Employee

              PopUpManager is for handling popups within a NativeWindow in AIR.  You probably want to instantiate a new Window component.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              • 4. Re: noob: createPopUp, popup is clipped by parent??
                artiescie Level 1

                So what it adds up to is: there is no answer for the question ?

                 

                i. .e to get modal window that is not clipped by it's parent.

                 

                If I use PopupManager, I get clipping of my window.

                 

                If I don't use PopupManager, I can't get a modal window.

                 

                No way to have both ?

                 

                tx

                Artie

                • 5. Re: noob: createPopUp, popup is clipped by parent??
                  Flex harUI Adobe Employee

                  There is no one function call to get both.  I think you can disable the Application when you open the new Window

                   

                  Alex Harui

                  Flex SDK Developer

                  Adobe Systems Inc.

                  Blog: http://blogs.adobe.com/aharui

                  1 person found this helpful