2 Replies Latest reply on May 24, 2010 4:48 AM by nikos101

    Can I use the awesome  <s:AnimateTransitionShader  in things other than state changes

    nikos101 Level 2

      It possible to use  the  <s:AnimateTransitionShader  in things other than state changes as theres some cool pb stuff you can do like here: http://www.justsuppose.com/getting-fancy-with-flex-4/

       

      <s:transitions>
              <s:Transition fromState="*" toState="log_in">
                  <s:AnimateTransitionShader target="{this}" duration="1000"
                                             shaderByteCode="@Embed(source='nikos/pixelBlender/HexCells.pbj',
                                             mimeType='application/octet-stream')"/>
              </s:Transition>
              <s:Transition fromState="*" toState="*">
                  <s:AnimateTransitionShader target="{logo}" duration="3000"
                                             shaderByteCode="@Embed(source='nikos/pixelBlender/Twist.pbj',
                                             mimeType='application/octet-stream')"/>
              </s:Transition>
             
          </s:transitions>

        • 1. Re: Can I use the awesome  <s:AnimateTransitionShader  in things other than state changes
          David_F57 Level 5

          hi,

           

          If you just want use pixelbender filters you create a shader job and use any animation you want...

           

          http://gumbo.flashhub.net/menu/   this uses a filter for the cross fade effect

           

           

          http://gumbo.flashhub.net/reflect/ this uses a pixelbender filter in a skin to create a reflection effect

           

           

          David.

          • 2. Re: Can I use the awesome  <s:AnimateTransitionShader  in things other than state changes
            nikos101 Level 2

            Firgured it:

             

            <?xml version="1.0"?>
            <!-- behaviors\SparkCustomPBTransform.mxml -->
            <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                xmlns:s="library://ns.adobe.com/flex/spark">

                 <fx:Script>
                      <![CDATA[

                        // Embed the .pbj file.
                        [Embed(source="assets/twist.pbj", mimeType="application/octet-stream")]
                        private static var CustomShaderClass:Class;
                        [Bindable]
                        private static var customShaderCode:ByteArray = new CustomShaderClass();
                      ]]>
                 </fx:Script>
                
                 <fx:Declarations>
                    <!-- Use the custom pixel shader with an effect. -->
                    <s:AnimateTransitionShader  id="shadeAnim"
                        shaderByteCode="{customShaderCode}"
                        target="{btn2}"
                        repeatCount="2"
                        repeatBehavior="reverse"/>
                 </fx:Declarations>

                 <mx:Button id="btn2" label="Click Me"
                      click="shadeAnim.play();">
                 </mx:Button>
            </s:Application>