1 Reply Latest reply on Jun 20, 2010 10:36 PM by flex2008

    Not able to stop flip effect available in the distortioneffects swc

    flex2008 Level 3

      Hi,

       

       

      I am using flip effect available in the distortioneffects.swc component(http://blogs.adobe.com/auhlmann/archives/2007/03/distortion_effe.html).I am trying to stop a running flip effect.Though the isPlaying property of the effect is false when i traced it,the effect continued playing.Using Flex 3 sdk.

       

      Here is a sample code snippet where you can reproduce this error:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:mxeffects="com.adobe.ac.mxeffects.*">
          <mx:Script>
              <![CDATA[
                  import mx.controls.Alert;
             
                  private function onBtn1Click():void
                  {
                      if(flip1.isPlaying)
                      {
                          flip1.stop();
                      }
                      viewstack1.selectedIndex = 0;
                  }
                 
                  private function onBtn2Click():void
                  {
                      if(flip2.isPlaying)
                      {
                          flip2.stop();
                      }
                      viewstack1.selectedIndex = 1;
                  }
              ]]>
          </mx:Script>
          <mx:Button x="170" y="153" label="One" click="onBtn1Click()"/>
          <mx:Button x="259" y="153" label="Two" click="onBtn2Click()"/>
          <mx:WipeLeft id="c1Effect" target="{c1}" duration="1000"/>
          <mx:WipeLeft id="c2Effect"  target="{c2}" duration="1000"/>
          <mxeffects:Flip id="flip1" target="{c1}" siblings="{[c2]}" duration="1000" direction="RIGHT"/>
          <mxeffects:Flip id="flip2" target="{c2}" siblings="{[c1]}" duration="1000" direction="LEFT"/>
          <mx:ViewStack x="170" y="212" id="viewstack1" width="261" height="200" creationPolicy="all">
              <mx:Canvas id="c1" width="100%" height="100%" hideEffect="{flip1}">
              <mx:DataGrid x="0" y="0" width="100%" height="100%">
                      <mx:columns>
                          <mx:DataGridColumn headerText="View1" dataField="col1"/>
                      </mx:columns>
                  </mx:DataGrid>
              </mx:Canvas>
              <mx:Canvas id="c2" width="100%" height="100%" hideEffect="{flip2}">
                  <mx:DataGrid x="0" y="0" width="100%" height="100%">
                      <mx:columns>
                          <mx:DataGridColumn headerText="View2" dataField="col1"/>
                      </mx:columns>
                  </mx:DataGrid>
              </mx:Canvas>
          </mx:ViewStack>
         
      </mx:Application>

       

       


      Steps to reproduce:

       

      1)Click Button 'two'.
      2)When the effect is playing,quickly click on Button 'one'.
      3)Effect continues to play and view1 not gets selected