鼠标悬浮效果-串行效果和并行效果

Posted on 2013-08-07 21:44  诸葛小北  阅读(250)  评论(0编辑  收藏  举报
<?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"
               creationComplete="init()"
               >
   <fx:Declarations>
       <s:Sequence id="effect" target="{boxes}">
           <s:Fade alphaFrom="{boxes.alpha}" alphaTo="1"/>
           <s:Scale scaleXTo="1" scaleXFrom="{boxes.scaleX}"
                    scaleYTo="1" scaleYFrom="{boxes.scaleY}"/>
       </s:Sequence>
   </fx:Declarations>
    <s:Group id="boxes" alpha=".2" x="20" y="20" scaleX=".5" scaleY=".5" rollOverEffect="{effect}">
        <s:Rect width="200" height="200">
            <s:fill>
                <s:SolidColor color="black"/>
            </s:fill>
        </s:Rect>
        
    </s:Group>
</s:Application> 
View Code

 以上为串行效果,使用Sequence

一下为并行效果,使用Parallel

<?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"
               creationComplete="init()"
               >
   <fx:Declarations>
       <s:Parallel id="effect" target="{boxes}">
           <s:Fade alphaFrom="{boxes.alpha}" alphaTo="1"/>
           <s:Scale scaleXTo="1" scaleXFrom="{boxes.scaleX}"
                    scaleYTo="1" scaleYFrom="{boxes.scaleY}"/>
       </s:Parallel>
   </fx:Declarations>
    <s:Group id="boxes" alpha=".2" x="20" y="20" scaleX=".5" scaleY=".5" rollOverEffect="{effect}">
        <s:Rect width="200" height="200">
            <s:fill>
                <s:SolidColor color="black"/>
            </s:fill>
        </s:Rect>
        
    </s:Group>
</s:Application> 
View Code
<?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"
               creationComplete="init()"
               >
   <fx:Declarations>
       <s:Parallel id="effect" target="{boxes}">
           <s:Fade alphaFrom="{boxes.alpha}" alphaTo="1"/>
           <s:Scale scaleXTo="1" scaleXFrom="{boxes.scaleX}"
                    scaleYTo="1" scaleYFrom="{boxes.scaleY}"/>
       </s:Parallel>
   </fx:Declarations>
    <s:Group id="boxes" alpha=".2" x="20" y="20" scaleX=".5" scaleY=".5" rollOverEffect="{effect}">
        <s:Rect width="200" height="200">
            <s:fill>
                <s:SolidColor color="black"/>
            </s:fill>
        </s:Rect>
        
    </s:Group>
</s:Application> 
View Code

 

Copyright © 2024 诸葛小北
Powered by .NET 8.0 on Kubernetes