5 Replies Latest reply on May 6, 2008 7:49 PM by _Greg_

    Component Popup Effects

    _Greg_
      Hi,

      I have a custom component which I am displaying with the PopUpManager. In the component MXML I have defined some effects, which I have bound to the showEffect and hideEffect properties of the component. The showEffect is not experienced the first time I show the popup -- but is experienced on subsequent shows.

      Any ideas why this might be the case?

      Many thanks,

      Greg
        • 1. Re: Component Popup Effects
          Gregory Lafrance Level 6
          Possible to see simple sample code.
          • 2. Re: Component Popup Effects
            _Greg_ Level 1
            Sure thing.

            Here's the code to show the popup:

            public var dataWindow : BRADataWindow;

            protected function showData() : void
            {

            var move : Move = new Move;

            if( dataWindow == null )
            {
            dataWindow = DataWindow(PopUpManager.createPopUp(this, DataWindow, false));
            dataWindow.addEventListener("close", dataWindow_close);
            PopUpManager.centerPopUp(dataWindow);

            move.xTo = 35;
            move.yTo = stage.height - 284;
            move.play([dataWindow]);

            }
            else
            {
            dataWindow.visible = true;

            move.xTo = 35;
            move.yTo = stage.height - 284;
            move.play([dataWindow]);
            }
            // m_data.dataProvider = solarArray;
            }

            And the beginning of my component :

            <?xml version="1.0" encoding="utf-8"?>
            <bra:BRADataWindow
            xmlns:mx=" http://www.adobe.com/2006/mxml"
            xmlns:bra="org.bra.*"
            layout="vertical"
            roundedBottomCorners="true"
            showCloseButton="true"
            width="440"
            height="235"
            backgroundColor="#F5F9FB"
            paddingBottom="10"
            paddingTop="10"
            paddingRight="10"
            paddingLeft="10"
            bottom="30"
            left="30"
            backgroundAlpha="0.8"
            title="Projects"
            horizontalScrollPolicy="off"
            verticalScrollPolicy="off"
            alpha=".8"
            showEffect="{fade}"
            hideEffect="{fade}"
            >

            <mx:Fade id="fade" duration="2000"/>
            • 3. Re: Component Popup Effects
              _Greg_ Level 1
              Missed this - which i likely relevant as well:

              private function dataWindow_close(event:Event):void
              {
              dataWindow.visible = false;
              (dataWindow);
              }
              • 4. Re: Component Popup Effects
                slaingod Level 1
                Generally there are issues when you first create something as the show effect doesn't occur, since the object is made visible by the creation event by default. You would need to also put the effect call in your creationComplete handler or similar. Once a component has been created, then subsequent show effects work as intended.
                • 5. Re: Component Popup Effects
                  _Greg_ Level 1

                  That makes some sense. Still learning here. :) Ill approach this a little differently then.

                  Thank you.