4 Replies Latest reply on Jun 2, 2006 11:18 AM by poonamsheth

    How to define the endEffect event in Flex 1.5

    Digital_Hand
      Hi all,

      I want once a particular effect (lets say resize effect) done play another effect.
      What should I write in the if statement to specify the end of the resize effect?

      Iam using Flex 1.5

      Thanks
        • 1. Re: How to define the endEffect event in Flex 1.5
          Andrew Spaulding Level 1
          Could you not use a Sequence effect?
          • 2. Re: How to define the endEffect event
            Level 7
            Have you taken a look at the Sequence effect tag? This can be used to play
            multiple child effects one after the other. The ASDoc example for Sequence
            effect has an example of how to insturment a Sequence effect in AS.

            Deepa Subramaniam - Flex SDK

            "Digital Hand" <webforumsuser@macromedia.com> wrote in message
            news:e3kojg$qdt$1@forums.macromedia.com...
            > Hi all,
            >
            > I want once a particular effect (lets say resize effect) done play another
            > effect.
            > What should I write in the if statement to specify the end of the resize
            > effect?
            >
            > Thanks


            • 3. Re: How to define the endEffect event in Flex 1.5
              poonamsheth Level 1
              yeh i have done a example for this very well,,
              well if u want one effect to work and then add the other effect .
              Its suppose to be said composite effects.

              here is the code for it. just run and see if its the doubt u asked for...

              ---------------
              main.mxml
              ---------------

              <?xml version="1.0"?>
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

              <mx arallel id="ZoomRotateShow">
              <mx:Zoom
              id="myZoomShow"
              zoomHeightFrom="0.0"
              zoomWidthFrom="0.0"
              zoomHeightTo="1.0"
              zoomWidthTo="1.0"/>
              <mx:Rotate
              id="myRotateShow"/>
              </mx arallel>

              <mx:Sequence id="ZoomRotateHide">
              <mx:Rotate
              id="myRotateHide"/>
              <mx:Zoom id="myZoomHide"
              zoomHeightFrom="1.0"
              zoomWidthFrom="1.0"
              zoomHeightTo="0.0"
              zoomWidthTo="0.0"/>
              </mx:Sequence>

              <mx:VBox id="myBox"
              autoLayout="false"
              hideEffect="{ZoomRotateHide}"
              showEffect="{ZoomRotateShow}">
              <mx:TextArea id="aTextArea"
              text="Was this Digital Hand's doubt? "
              width="329"
              height="277"/>
              </mx:VBox>

              <mx:Button id='myButton'
              click="myBox.visible = !myBox.visible;"
              label="ZoomRotate!"/>

              </mx:Application>
              • 4. Re: How to define the endEffect event in Flex 1.5
                poonamsheth Level 1
                YOu can also do it in programmatic way.. in ActionScript mode instaead of Sequence and Parallel effect.
                ---------------
                main.mxml
                ----------------
                <?xml version="1.0"?>
                <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="createEffect(event);">

                <mx:Script>
                <![CDATA[

                // Import effect classes and create effect variables.
                import mx.effects.*;
                private var resizeLarge:Resize;
                private var moveToRight:Move;
                private var resizeAndMove:Parallel;

                private function createEffect(eventObj:Event):void {
                // Create a Resize effect.
                resizeLarge = new Resize(myText);
                // Set resized width and height, and effect duration.
                resizeLarge.widthTo=150;
                resizeLarge.heightTo=150 ;
                resizeLarge.duration=750;

                // Initialize a Move effect.
                moveToRight = new Move(myText);
                moveToRight.xTo=200;
                moveToRight.duration=750;

                // Initialize a Parallel effect.
                resizeAndMove = new Parallel();
                resizeAndMove.addChild(resizeLarge);
                resizeAndMove.addChild(moveToRight);
                }
                ]]>
                </mx:Script>

                <mx:Button click="resizeAndMove.play();"/>
                <mx:TextArea id="myText" text="Here is some text."/>
                </mx:Application>