My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
AnimateComplexPathEffect  
How to use the AnimateComplexPath effect
Updated Jun 3, 2010 by fabien.b...@gmail.com

AnimateComplexPath is a standard Effect class.

Specific properties

target and targets properties must to target ComplexPath primitive (see ComplexPath primitive wiki entry).

Sample
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               minWidth="955" 
               minHeight="600" 
               xmlns:uigfx="http://uigfx.lafabrick.com"  viewSourceURL="srcview/index.html">

    <fx:Script>
        <![CDATA[
            protected function group1_rollOverHandler(event:MouseEvent):void
            {
                animOut.stop(); 
                animIn.play();
                
                colorAnimOut.stop();
                colorAnimIn.play();
            }

            protected function group1_rollOutHandler(event:MouseEvent):void
            {
                animIn.stop(); 
                animOut.play();
                
                colorAnimIn.stop();
                colorAnimOut.play();
            }

        ]]>
    </fx:Script>

    <fx:Declarations>
        <s:Elastic id="elastic" />
        <s:Bounce id="bounce" />
        
        <s:AnimateColor id="colorAnimIn" target="{fillCol}" colorTo="#00D5BA" />
        <s:AnimateColor id="colorAnimOut" duration="1000" target="{fillCol}" colorTo="#009EE0" />
        
        <uigfx:AnimateComplexPath id="animIn"
            targets="{[cmpPath, cmpPath2]}"
            easer="{elastic}"
            dataTo=" C D H 0 T -41 S 1.96 0 P -1.96 0 D R 27 T 18 S 2.59 1.51 P -2.59 -1.51 D R -32 T 4 S 0.98 1.72 P -0.98 -1.72 D R 9 V 0 S 0 3.03 P 0 -3.03 D R -32 B 4 S -0.98 1.72 P 0.98 -1.72 D R 27 B 18 S -2.59 1.51 P 2.59 -1.51 D H 0 B -41 S -1.96 0 P 1.96 0 D L 27 B 18 S -2.59 -1.51 P 2.59 1.51 D L -32 B 4 S -0.98 -1.72 P 0.98 1.72 D L 9 V 0 S 0 -3.03 P 0 3.03 D L -32 T 4 S 0.98 -1.72 P -0.98 1.72 D L 27 T 18 S 2.59 -1.51 P -2.59 1.51" />

        <uigfx:AnimateComplexPath 
            id="animOut"
            targets="{[cmpPath, cmpPath2]}"
            
            easer="{bounce}"
            duration="1000"
            dataTo=" C D H 0 T 0 S 28.64 0 P -28.64 0 D R 14 T -4 S 4.9 2.87 P -4.9 -2.87 D R 3 T 24 S 14.32 25.14 P -14.32 -25.14 D R -15 V 0 S 0 5.73 P 0 -5.73 D R 3 B 24 S -14.32 25.14 P 14.32 -25.14 D R 14 B -4 S -4.9 2.87 P 4.9 -2.87 D H 0 B 0 S -28.64 0 P 28.64 0 D L 14 B -4 S -4.9 -2.87 P 4.9 2.87 D L 3 B 24 S -14.32 -25.14 P 14.32 25.14 D L -15 V 0 S 0 -5.73 P 0 5.73 D L 3 T 24 S 14.32 -25.14 P -14.32 25.14 D L 14 T -4 S 4.9 -2.87 P -4.9 2.87" />
        
    </fx:Declarations>
    
    <s:Group 
        horizontalCenter="0" verticalCenter="0"
        width="100" height="100" 
        rollOver="group1_rollOverHandler(event)"
        rollOut="group1_rollOutHandler(event)"
        >
        
        <uigfx:ComplexPath 
            id="cmpPath"
            horizontalCenter="0" verticalCenter="0"
            
            top="0" bottom="0" left="0" right="0"
            data=" C D H 0 T 0 S 28.64 0 P -28.64 0 D R 14 T -4 S 4.9 2.87 P -4.9 -2.87 D R 3 T 24 S 14.32 25.14 P -14.32 -25.14 D R -15 V 0 S 0 5.73 P 0 -5.73 D R 3 B 24 S -14.32 25.14 P 14.32 -25.14 D R 14 B -4 S -4.9 2.87 P 4.9 -2.87 D H 0 B 0 S -28.64 0 P 28.64 0 D L 14 B -4 S -4.9 -2.87 P 4.9 2.87 D L 3 B 24 S -14.32 -25.14 P 14.32 25.14 D L -15 V 0 S 0 -5.73 P 0 5.73 D L 3 T 24 S 14.32 -25.14 P -14.32 25.14 D L 14 T -4 S 4.9 -2.87 P -4.9 2.87" >
                   
            <uigfx:fill>
                <s:SolidColor id="fillCol" color="#009EE0" />
            </uigfx:fill>
            
            <uigfx:filters>
                <s:GlowFilter inner="true" color="#000000" alpha="0.6" blurX="8" blurY="8" />
                
            </uigfx:filters>
            
        </uigfx:ComplexPath>
                
        <uigfx:ComplexPath 
            id="cmpPath2"
            horizontalCenter="0" verticalCenter="0"
            
            top="0" bottom="0" left="0" right="0"
            data=" C D H 0 T 0 S 28.64 0 P -28.64 0 D R 14 T -4 S 4.9 2.87 P -4.9 -2.87 D R 3 T 24 S 14.32 25.14 P -14.32 -25.14 D R -15 V 0 S 0 5.73 P 0 -5.73 D R 3 B 24 S -14.32 25.14 P 14.32 -25.14 D R 14 B -4 S -4.9 2.87 P 4.9 -2.87 D H 0 B 0 S -28.64 0 P 28.64 0 D L 14 B -4 S -4.9 -2.87 P 4.9 2.87 D L 3 B 24 S -14.32 -25.14 P 14.32 25.14 D L -15 V 0 S 0 -5.73 P 0 5.73 D L 3 T 24 S 14.32 -25.14 P -14.32 25.14 D L 14 T -4 S 4.9 -2.87 P -4.9 2.87">
                   
            <uigfx:fill>
                <s:LinearGradient rotation="90">
                    <s:GradientEntry color="#FFFFFF" alpha="0.4" ratio="0" />
                    <s:GradientEntry color="#FFFFFF" alpha="0" ratio="0.5" />
                </s:LinearGradient>
            
            </uigfx:fill>
            
        </uigfx:ComplexPath>
        
    </s:Group>
    
    
</s:Application>

Warning ! The dataTo property must to store a path with same types and same number of vectors.


Sign in to add a comment
Powered by Google Project Hosting