2 Replies Latest reply on Apr 9, 2010 7:12 AM by ben_marker

    HideEffect error from TileWindow close event

    ben_marker

      I'm attempting to use a hideEffect from the TileWindow component from the close event, but I"m getting an error and don't understand why.  How can I make the hideEffect work?  The showEffect works fine...

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
          <mx:Script>
              <![CDATA[
                  import mx.events.CloseEvent;
                  private function twCloser(event:CloseEvent):void
                  {
                        largeImgTW.visible=false;
                  }
                  private function twOpener(event:MouseEvent):void
                  {
                      largeImgTW.visible=true;
                  }
              ]]>
          </mx:Script>
         
          <mx:Sequence id="fadeInTW" >
              <mx:Parallel>
                  <mx:Fade alphaFrom="0.0" alphaTo="1.0" duration="1000"/>
                  <mx:WipeDown duration="1000" />       
              </mx:Parallel>   
          </mx:Sequence>
          <mx:Sequence id="fadeOutTW" >
              <mx:Parallel>
                  <mx:Fade alphaFrom="1.0" alphaTo="0.0" duration="1000"/>
                  <mx:WipeUp duration="1000" />       
              </mx:Parallel>   
          </mx:Sequence>
         
          <mx:Button label="launch Tile Window" click="twOpener(event)"/>
             
          <mx:TitleWindow id="largeImgTW" layout="absolute" x="417" y="192" showCloseButton="true" close="twCloser(event)" visible="false" showEffect="{fadeInTW}" hideEffect="{fadeOutTW}">
              <mx:Canvas width="200" height="200" backgroundColor="#ff0000"/>
          </mx:TitleWindow>
      </mx:Application>

        • 1. Re: HideEffect error from TileWindow close event
          Vikash.kumar29 Level 3

          Hmmm Strange!!!

          Seems like a bug which requires target for parallel effect while hide only but does not set it.

           

           

           

          For the time being you can remove the sequence effect as there is no othe effect other than parallel and use effect like

           

                   <mx:Parallel id="fadeOutTw">
                      <mx:Fade alphaFrom="1.0" alphaTo="0.0" duration="1000"/>
                      <mx:WipeUp duration="1000" />       
                  </mx:Parallel>

           

          or you can also set target explicitly like :

           

          <mx:Sequence id="fadeOutTW" >
                  <mx:Parallel target="{largeImgTW}">
                      <mx:Fade alphaFrom="1.0" alphaTo="0.0" duration="1000"/>
                      <mx:WipeUp duration="1000" />       
                  </mx:Parallel>   
              </mx:Sequence>

           

          I have tested on this code, and works fine. Hope this helps you

           

          -Vikash

          • 2. Re: HideEffect error from TileWindow close event
            ben_marker Level 1

            thanks for the fix.  I"m still a semi-noob to Flex