<s:transitions>
<s:Transition fromState="default">
<s:Parallel>
<mx:Resize target="{loginPanel}" duration="100"/>
<s:Wipe direction="right" target="{confirm}"/>
</s:Parallel>
</s:Transition>
<s:Transition fromState="Register">
<s:Sequence>
<mx:Resize target="{loginPanel}" duration="100"/>
</s:Sequence>
</s:Transition>
</s:transitions>
<s:transitions>
<s:Transition id="trans" fromState="*" toState="*">
<s:Sequence>
<s:Resize duration="800" target="{viewBox}"/>
<s:Rotate angleBy="180" autoCenterTransform="true" duration="300" target="{bt}"/>
</s:Sequence>
</s:Transition>
</s:transitions>

transitions: 一个 Transition 对象 Array,其中的每个 Transition 对象都定义一组效果,用于在视图状态发生更改时播放。

普通效果:定义后,在指定的时候播放。

指定的时间:

1.在执行play(),end()的时候播放。

2.在指定发生事件里播放,比如: hideEffect="{dissolveOut}"  showEffect="{dissolveIn}"

<?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"> <fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub }
]]>
</fx:Script> <fx:Declarations>
<!--动画效果-->
<mx:AnimateProperty id="animateProperty" property="scaleX" fromValue="1" toValue="2" duration="1000"/>
<mx:AnimateProperty id="animateProperty1" property="scaleX" fromValue="2" toValue="1" duration="1000"/>
<!--模糊效果-->
<mx:Blur id="blurImage" duration="1000" blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
<mx:Blur id="blurImage1" duration="1000" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
<!--发光效果-->
<mx:Glow id="glowImage" duration="1000" alphaFrom="1.0" alphaTo="0.3" blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0" color="0xFF0000"/>
<mx:Glow id="glowImage1" duration="1000" alphaFrom="0.3" alphaTo="1" blurXFrom="50.0" blurXTo="0.0" blurYFrom="50.0" blurYTo="0.0" color="0xFF0000"/> <!--dissolve效果,,,用于显示和隐藏-->
<mx:Dissolve id="dissolveOut" duration="1000" alphaFrom="1.0" alphaTo="0.0" color="0xff0000"/>
<mx:Dissolve id="dissolveIn" duration="1000" alphaFrom="0.0" alphaTo="1.0" color="0xff0000"/>
<!--fade淡入淡出效果-->
<mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
<mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>
<!--虹效果,-->
<mx:Iris id="irisOut" duration="1000" showTarget="true"/>
<mx:Iris id="irisIn" duration="1000" showTarget="false"/>
<!--Rotate旋转效果-->
<mx:Rotate id="rotate" angleFrom="-45" angleTo="0" target="{img2}" duration="2000"/> <mx:Resize id="expand" target="{img3}" widthTo="265" heightTo="265"/>
<mx:Resize id="contract" target="{img3}" widthTo="25" heightTo="40"/>
</fx:Declarations> <mx:HBox>
<mx:VBox>
<mx:Image id="img1" source="asdf.jpg" rollOverEffect="{animateProperty}" rollOutEffect="{animateProperty1}" />
<mx:Image id="img" source="asdf.jpg" rollOverEffect="{blurImage}" rollOutEffect="{blurImage1}" />
<mx:Image source="asdf.jpg" rollOverEffect="{glowImage}" rollOutEffect="{glowImage1}"/>
</mx:VBox>
<mx:VBox>
<mx:VBox>
<mx:CheckBox id="cbx2" label="visible" selected="true"/>
<mx:Image source="asdf.jpg" visible="{cbx2.selected}" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
</mx:VBox> <mx:VBox>
<mx:CheckBox id="cbx" label="visible" selected="true"/>
<mx:Image source="asdf.jpg" visible="{cbx.selected}" hideEffect="{fadeOut}" showEffect="{fadeIn}"/>
</mx:VBox>
<mx:VBox>
<mx:CheckBox id="cbx1" label="visible" selected="true"/>
<mx:Image id="Flex" source="asdf.jpg" visible="{cbx1.selected}" showEffect="{irisIn}" hideEffect="{irisOut}"/>
</mx:VBox>
</mx:VBox>
<mx:VBox>
<mx:Image id="img2" source="asdf.jpg" addedEffect="rotate"/>
</mx:VBox>
<mx:VBox> <mx:ControlBar>
<mx:Button label="Expand" click="expand.end();expand.play();"/>
<mx:Button label="Contract" click="contract.end();contract.play();"/>
</mx:ControlBar>
<mx:Image id="img3" width="25" height="40" source="asdf.jpg"/>
</mx:VBox> </mx:HBox> </s:Application>
<s:states>
<s:State name="collapsed"/>
<s:State name="expanded"/>
</s:states>
<s:transitions>
<s:Transition id="trans" fromState="*" toState="*">
<s:Sequence>
<s:Resize duration="800" target="{viewBox}"/>
</s:Sequence>
</s:Transition>
</s:transitions>
<s:Group id="viewBox" right="0" bottom="0" width="186" height="186"
right.collapsed="0" bottom.collapsed="0" width.collapsed="0" height.collapsed="0">
<s:BorderContainer id="zzz" left="5" right="5" top="5" bottom="5" width="180" height="180"
borderStyle="solid" cornerRadius="3"/>
<mx:Box visible="{ovmap_show}" width="186" height="186" backgroundColor="#0D84CD"
borderStyle="solid" cornerRadius="3" horizontalAlign="center"
includeInLayout="{ovmap_show}" verticalAlign="middle"
right.collapsed="0" bottom.collapsed="0" width.collapsed="0" height.collapsed="0">
<s:Group width="180" height="180" cacheAsBitmap="true"
creationComplete="viewBox_creationCompleteHandler(event)" mask="{zzz}"
right.collapsed="30" bottom.collapsed="30" width.collapsed="0"
height.collapsed="0">
<s:Rect id="vborder" left="0" right="0" top="0" bottom="0">
<s:fill>
<s:SolidColor alpha="1" color="0xFFFFFF"/>
</s:fill>
</s:Rect>
<esri:Map id="ovMap" width="180" height="180" clickRecenterEnabled="false"
doubleClickZoomEnabled="false" keyboardNavigationEnabled="false"
load="ovMapLoaded(event)" logoVisible="false" panArrowsVisible="false"
panEnabled="false" rubberbandZoomEnabled="false" scaleBarVisible="false"
scrollWheelZoomEnabled="false" zoomSliderVisible="false"/>
<s:filters>
<mx:DropShadowFilter alpha="0.3" angle="45" distance="5" inner="true"/>
</s:filters>
</s:Group>
</mx:Box>
</s:Group>
<mx:SWFLoader id="bt" right="2" bottom="2" width="20" height="20" click="toggleView(event)"
complete="overviewbtn_complete(event)"
source="widgets/OverviewMap/assets/overviewbtn.swf"
toolTip.collapsed="{openToolTip}"
toolTip.expanded="{closeToolTip}" toolTipShow="bt_toolTipShowHandler(event)"/>

flex 4 transition的更多相关文章

  1. css3有哪些新特性?

    新选择器,属性选择器.伪类选择器.层次选择器... 圆角属性border-radius font-face加载服务器端的字体 多列布局column 阴影shadow 弹性盒flex 过渡transit ...

  2. 前端面试题-HTML+CSS

    引用GitHub 上 ltadpoles的前端面试 https://github.com/ltadpoles HTML部分 1. Doctype作用,HTML5 为什么只需要写<!DOCTYPE ...

  3. 前端移动端开发总结(Vue)

    上下固定,中间滚动布局(FLEX) <div id="app"> <div class="header"></div> &l ...

  4. 常用css3属性的ie兼容查看

    记录一下关于css3的各种常用属性对ie各版本浏览器的兼容程度: 最低可兼容ie7 最低可兼容ie8 最低可兼容ie9 最低可兼容ie10 position:fixed clip E:first-le ...

  5. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十一)路径导航模块

    config.xml文件的配置如下: <widget label="路径导航" icon="assets/images/lujingdaohang.png" ...

  6. FLEX的动画

    1.使用自带效果 在Flex里面不像在Flash里面随意制作动画了,Flex更趋向于应用程序,而不是动画制作了,所以没有了时间轴的概念.在Flex中使用动画效果,可以用Flex自带的Effect,或者 ...

  7. vue2.0 transition -- demo实践填坑

    前言 vue1.0版本和2.0版本的过渡系统改变还是蛮彻底的,具体请自行详看文档介绍:https://vuefe.cn/v2/guide/migration.html#过渡.在使用2.0版本做过渡效果 ...

  8. flex/bison 计算器

    flex %{ #include <stdio.h> #include "mycalc.tab.h" ;} %} %% "+" return ADD ...

  9. CSS Flex

    关于flex 请看这里  https://css-tricks.com/snippets/css/a-guide-to-flexbox/ 太详细啦!!!  还通俗易懂!!! 没啥好说的 不过上面那篇文 ...

随机推荐

  1. Spring MVC 环境搭建(一)

    一.建立 JavaWeb 项目 1.建立一个 Java 项目. 2.在项目下新建一个文件夹 webapp (命名可自取,这个目录即是网站根目录),再在该文件夹下新建一个 WEB-INF 文件夹(命名固 ...

  2. Codeforces Round #350 (Div. 2) E. Correct Bracket Sequence Editor 模拟

    题目链接: http://codeforces.com/contest/670/problem/E 题解: 用STL的list和stack模拟的,没想到跑的还挺快. 代码: #include<i ...

  3. 01.Hibernate入门

    前言:本文用一个简单的Hibernate应用程序例子来引领初学者入门,让初学者对Hibernate的使用有一个大致的认识.本文例子使用了MySQL数据库.Maven管理工具.Eclipse开发工具,创 ...

  4. NYOJ-235 zb的生日 AC 分类: NYOJ 2013-12-30 23:10 183人阅读 评论(0) 收藏

    DFS算法: #include<stdio.h> #include<math.h> void find(int k,int w); int num[23]={0}; int m ...

  5. 奶牛通讯 usaco 网络流

    这道题很有意思,原题是只需输出最小割集大小,现在oj上改成了输出字典序最小的割集: 题解:可以考虑从小到大删边,若删掉这条边后,最小割变小,保持不变,记录此时的最小割大小: 若最小割不变,恢复这条边: ...

  6. [工作记录] Android OpenSL ES: references & AAC related

    AAC V.S. MP3 http://en.wikipedia.org/wiki/Advanced_Audio_Coding#AAC.27s_improvements_over_MP3 AAC pa ...

  7. ACM入门记

    [2015.12]零基础进队 [2016.4.10]浙大第十六届程序设计大赛 [2016.6.4]团体程序设计天梯赛初赛 [2016.7.16]团体程序设计天梯赛决赛 赛后总结:比赛的时候好慌,一道题 ...

  8. HDOJ 1028 Ignatius and the Princess III (母函数)

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  9. vi编辑器的常见使用技巧

    光标移动 在普通模式下, 1.按 h 向左移动光标 按 h + 数字n 可以向右移动 n个字符   比如 h + 5  就是向左移动5个字符 2.按j向下移动光标 3.按k向上移动光标 4.按 l 向 ...

  10. Web App中的Flexbox应用

    虽然语法可能比较混杂,但 Flexbox 还是名不虚传的.它创造的是可伸缩的.有弹性的.可改变视觉顺序的智能盒子.它提供了简单的CSS布局方案范例让容器总是处于垂直水平居中的位置.使用盒模型来工作是非 ...