Skip to main content
nikos101
Inspiring
October 26, 2011
Answered

How do you allow the popup to be moved about when inside a <s:SkinnablePopUpContainer>

  • October 26, 2011
  • 1 reply
  • 11280 views

How do you allow the popup to be moved about when you open it like this

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

               xmlns:s="library://ns.adobe.com/flex/spark"

               xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Declarations>

        <fx:Component className="MyAlert">

            <s:SkinnablePopUpContainer>

                <s:TitleWindow title="Launching World Domination..." close="close()">

                    <s:VGroup horizontalAlign="center" width="100%">

                        <s:Label text="World Domination failed. Sorry!"/>

                        <s:Button label="OK, nevermind" click="close()"/>

                    </s:VGroup>

                </s:TitleWindow>

            </s:SkinnablePopUpContainer>

        </fx:Component>

    </fx:Declarations>

    <s:Button label="Launch World Domination" click="(new MyAlert()).open(this, false)"/>

</s:Application>

    This topic has been closed for replies.
    Correct answer Jason San Jose

    A TitleWindow in a SkinnablePopUpContainer is a pop-up* in a pop-up. I'm guessing that's not what you were going for. See http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html for TitleWindow usage.

    If you wanted something skinnable and moves, just skin TitleWindow.

    If you wanted something that's skinnable and has open/close effects (but no built-in moveArea), use SkinnablePopUpContainer.

    If you want to combine the two, well, I'm not sure that it would work the way you'd want it. Since you're not using TitleWindow as a pop-up, it gets laid out like a Panel in the SkinnablePopUpContainer's layout. I'm assuming you've tried the code you've posted and it doesn't work?

    For me, I'd try just using a TitleWindow as documented, then specify show and hide effects on the TitleWindow (<s:TitleWindow show="{myEffectId}"/>).

    Hope that helps.

    * It's actually a Panel in a pop-up

    Jason San Jose

    Software Engineer, Flex

    1 reply

    Jason San Jose
    Adobe Employee
    Jason San JoseCorrect answer
    Adobe Employee
    October 28, 2011

    A TitleWindow in a SkinnablePopUpContainer is a pop-up* in a pop-up. I'm guessing that's not what you were going for. See http://help.adobe.com/en_US/flex/using/WS6c678f7b363d5da52e8f1ca1124a0430dcf-8000.html for TitleWindow usage.

    If you wanted something skinnable and moves, just skin TitleWindow.

    If you wanted something that's skinnable and has open/close effects (but no built-in moveArea), use SkinnablePopUpContainer.

    If you want to combine the two, well, I'm not sure that it would work the way you'd want it. Since you're not using TitleWindow as a pop-up, it gets laid out like a Panel in the SkinnablePopUpContainer's layout. I'm assuming you've tried the code you've posted and it doesn't work?

    For me, I'd try just using a TitleWindow as documented, then specify show and hide effects on the TitleWindow (<s:TitleWindow show="{myEffectId}"/>).

    Hope that helps.

    * It's actually a Panel in a pop-up

    Jason San Jose

    Software Engineer, Flex

    nikos101
    nikos101Author
    Inspiring
    October 31, 2011

    thanks Jason, the reason I wanted to use the skinnableP was so I could do this and have the nice background in all my popups:

    global {

        modalTransparencyBlur: 0;

        modalTrancparency: 0.8;

        modalTransparencyColor: black;

        modalTransparencyDuration: 500;

        roll-over-color: #CAD9F0;

    }