1 Reply Latest reply on Nov 13, 2010 6:28 PM by John Hall

    Parallel effect does not work

    fagagou

      Hy,

       

      i created a parallel effect but it does not work, i am good looking for a solution, thanks

       

      <?xml version="1.0" encoding="utf-8"?>
      <!-- http://blog.flexexamples.com/2007/08/27/resizing-a-flex-accordion-container-to-fit-its-contents/ -->
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
              layout="vertical"
              verticalAlign="top"
              creationComplete="launch()">
      <mx:Script>
          <![CDATA[
              public function launch():void{            
                  ChangeBoxContent.play();
              }
          ]]>
      </mx:Script>
      
      <mx:Parallel id="ChangeBoxContent">
              <mx:Resize target="{Box1}" heightTo="235" />
              <mx:Move target="{Box1}" yTo="0"/>
      </mx:Parallel>
      
      <mx:VBox id="Box1">
          <mx:Label text="hello 1"/>
      </mx:VBox>
      <mx:VBox id="Box2">
          <mx:Label text="hello 2" height="10"/>
      </mx:VBox>
      
      </mx:WindowedApplication>
      
        • 1. Re: Parallel effect does not work
          John Hall Level 4

          I think it's working. It just happens so quickly you're not seeing the effect. You can put a timer on it to fire off the event after the application is complete.

           

           

           

          <?xml version="1.0" encoding="utf-8"?>
          
          <!-- http://blog.flexexamples.com/2007/08/27/resizing-a-flex-accordion-container-to-fit-its-contents/ -->
          <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
                                        layout="vertical"
                                        verticalAlign="top"
                                        creationComplete="launch()">
               <mx:Script>
                    <![CDATA[
                         private var myTimer : Timer;
          
                         public function launch() : void {
                              myTimer = new Timer( 1000, 1 );
                              myTimer.addEventListener( TimerEvent.TIMER, changeit );
                              myTimer.start();
                         }
          
                         private function changeit( e : TimerEvent ) : void {
                              myTimer.removeEventListener( TimerEvent.TIMER, changeit );
                              ChangeBoxContent.play()
                         }
                    ]]>
               </mx:Script>
          
               <mx:Parallel id="ChangeBoxContent">
                    <mx:Resize target="{Box1}"
                                 heightTo="235"/>
          
                    <mx:Move target="{Box1}"
                               yTo="0"/>
               </mx:Parallel>
          
               <mx:VBox id="Box1">
                    <mx:Label text="hello 1"
                                width="52"
                                height="25"
                                textAlign="center"/>
               </mx:VBox>
          
               <mx:VBox id="Box2">
                    <mx:Label text="hello 2"
                                height="29"
                                width="56"
                                textAlign="center"/>
               </mx:VBox>
          </mx:WindowedApplication>