`

Flex事件效果与渲染

    博客分类:
  • Flex
 
阅读更多
触发器名称                         对应事件名称                    事件描述

addedEffect                     added                       当组件被添加到容器时触发
createCompleteEffect      createComplete        当组件完成绘制时触发 
focusInEffect                    focusIn                    当组件获得光标焦点时触发
focusOutEffect                 focusOut                   当组件失去光标焦点时触发
hideEffect                        hide                          当组件变成不可见时触发
showEffect                      show                         当组件变成可见时触发
mouseDownEffect           mouseDown              当鼠标在组件上按下时触发
mouseUpEffect                mouseUp                    当鼠标在组件上松开时触发
rollOverEffect                   rollOver                      当鼠标移动到组件上时触发
moveEffect                      move                          当组件被移动时触发
resizeEffect                     resize                          当组件改变大小时触发


Effect中

引用

<mx:AnimateProperty>可实现拉伸效果
<mx:Blur>模糊效果
<mx:Dissolve>实现淡出淡入效果,与<mx:Fade>相似
<mx:Glow>外发光效果
<mx:Iris>以矩形方式出现或消失
<mx:Move>移动效果
<mx:Parallel>多种效果叠加
<mx:Pause>停止   mx.effects.easing.Bounce.easeOut可产生弹动效果
<mx:Resize>改变大小
<mx:Rotate>旋转角度
<mx:SoundEffect>声音效果
<mx:WipeDown>从上往下消失或出现
<mx:WipeLeft>从右往左消失或出现
<mx:WipeRight>从左往右消失或出现
<mx:WipeUp>从下往上消失或出现
<mx:Zoom>放大或缩小
</mx:Transition>不同state切换时的过渡效果

Charts(统计)
<mx:AreaChart>是一种以面积作为表示方式
<mx:AxisRenderer>是一种轴图,股票交易常以这种方式表示
<mx:BarChart>是柱状图
<mx:BubbleChart>气泡图
<mx:CandlestickChart>一种比较有趣的图,”涨”跟”跌”的颜色会不一样
<mx:CategoryAxis>跟AxisRenderer很像
<mx:ColumnChart>跟<mx:BarChart>很像
<mx:DateTimeAxis>以日期为轴的折线图
<mx:GridLines>多条线图
<mx:HLOCChart>跟AxisRenderer很像
<mx:Legend>图例,离散的点
<mx:LinearAxis>Axis系列
<mx:LineChart>折线图
<mx:LogAxis>Axis系列
<mx:PieChart>饼图
<mx:PlotChart>跟Legend很像



1.Resize

  尺寸调整效果,改变组件的长和宽。当改变组件的长和宽时,处于同一个容器的其他组件的大小也可能会相应改变,如果该容器使用了绝对定位则不会发生这种情况。



Java代码 
<?xml version="1.0"?>  
<!-- Simple example to demonstrate the Effect class. -->  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">  
    <mx:Script>  
        <![CDATA[  
            import mx.controls.Alert;  
            // Event handler for the effectEnd event.             
            private function endEffectHandler():void {  
                Alert.show("Effect Ended!");  
            }  
 
            // Event handler for the reset button.             
            private function resetHandler():void {  
                expand.end();  
                img.width=30;  
                img.height=60;  
                button1.enabled=true;  
            }  
        ]]>  
    </mx:Script>  
 
 
    <mx:Resize id="expand" target="{img}" widthTo="100" heightTo="200" 
        duration="10000" effectEnd="endEffectHandler();"/>  
 
    <mx:Panel title="Resize Effect Example" width="100%" height="100%" 
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">  
 
        <mx:Text width="100%" color="blue" 
            text="Use the Button controls to control the Resize effect."/>  
 
        <mx:Image id="img" width="30" height="60" 
            source="@Embed(source='1.jpg')"/>  
      
        <mx:ControlBar>  
            <mx:Button id="button1" label="Start" click="expand.play(); button1.enabled=false;"/>  
            <mx:Button label="Pause" click="expand.pause();"/>  
            <mx:Button label="Resume" click="expand.resume();"/>  
            <mx:Button label="Reverse" click="expand.reverse();"/>  
            <mx:Button label="End" click="expand.end();"/>  
            <mx:Button label="Reset" click="resetHandler();"/>  
        </mx:ControlBar>  
         
    </mx:Panel>  
</mx:Application> 

<?xml version="1.0"?>
<!-- Simple example to demonstrate the Effect class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            // Event handler for the effectEnd event.          
            private function endEffectHandler():void {
                Alert.show("Effect Ended!");
            }

            // Event handler for the reset button.          
            private function resetHandler():void {
                expand.end();
                img.width=30;
                img.height=60;
                button1.enabled=true;
            }
        ]]>
    </mx:Script>


    <mx:Resize id="expand" target="{img}" widthTo="100" heightTo="200"
        duration="10000" effectEnd="endEffectHandler();"/>

    <mx:Panel title="Resize Effect Example" width="100%" height="100%"
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

        <mx:Text width="100%" color="blue"
            text="Use the Button controls to control the Resize effect."/>

        <mx:Image id="img" width="30" height="60"
            source="@Embed(source='1.jpg')"/>
   
        <mx:ControlBar>
            <mx:Button id="button1" label="Start" click="expand.play(); button1.enabled=false;"/>
            <mx:Button label="Pause" click="expand.pause();"/>
            <mx:Button label="Resume" click="expand.resume();"/>
            <mx:Button label="Reverse" click="expand.reverse();"/>
            <mx:Button label="End" click="expand.end();"/>
            <mx:Button label="Reset" click="resetHandler();"/>
        </mx:ControlBar>
      
    </mx:Panel>
</mx:Application>

2.Glow

发光效果,使用了GlowFilter 滤镜。当对组件使用了该效果,不可再使用GlowFilter 滤镜和其他发光效果。



Java代码 
<?xml version="1.0" encoding="utf-8"?>  
<!-- Simple example to demonstrate the Glow effect. -->  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">  
 
    <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="0x00FF00"/>  
        
    <mx:Glow id="unglowImage" duration="1000" 
        alphaFrom="0.3" alphaTo="1.0" 
        blurXFrom="50.0" blurXTo="0.0" 
        blurYFrom="50.0" blurYTo="0.0" 
        color="0x0000FF"/>  
 
    <mx:Panel title="Glow Effect Example" width="75%" height="75%" 
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">  
 
        <mx:Text width="100%" color="blue" 
            text="Click and hold the mouse on the image to see glowImage effect. Release the mouse to see unglowImage effect."/>  
             
        <mx:Image source="@Embed(source='1.jpg')" 
            mouseDownEffect="{glowImage}" 
            mouseUpEffect="{unglowImage}"/>  
         
    </mx:Panel>  
</mx:Application> 

<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Glow effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <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="0x00FF00"/>
     
    <mx:Glow id="unglowImage" duration="1000"
        alphaFrom="0.3" alphaTo="1.0"
        blurXFrom="50.0" blurXTo="0.0"
        blurYFrom="50.0" blurYTo="0.0"
        color="0x0000FF"/>

    <mx:Panel title="Glow Effect Example" width="75%" height="75%"
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

        <mx:Text width="100%" color="blue"
            text="Click and hold the mouse on the image to see glowImage effect. Release the mouse to see unglowImage effect."/>
          
        <mx:Image source="@Embed(source='1.jpg')"
            mouseDownEffect="{glowImage}"
            mouseUpEffect="{unglowImage}"/>
      
    </mx:Panel>
</mx:Application>
 


3.Iris
彩虹效果,组件以矩形方式,从中心放大或缩小到中心。属于遮罩效果。



Java代码 
<?xml version="1.0"?>  
<!-- Simple example to demonstrate the Iris effect. -->  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">  
 
    <mx:Iris id="irisOut" duration="1000" showTarget="true"/>  
    <mx:Iris id="irisIn" duration="1000" showTarget="false"/>  
 
    <mx:Panel title="Iris Effect Example" width="75%" height="75%" 
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">  
 
        <mx:Text width="100%" color="blue" 
            text="Use the Iris effect to show or hide the phone image."/>  
 
        <mx:Image id="flex" source="@Embed(source='1.jpg')"   
            visible="{cb1.selected}" 
            showEffect="{irisIn}" hideEffect="{irisOut}"/>  
 
        <mx:CheckBox id="cb1" label="visible" selected="true"/>  
   
 
   </mx:Panel>  
</mx:Application> 
分享到:
评论

相关推荐

    flex3的cookbook书籍完整版dpf(包含目录)

    第一章.Flex与ActionScript基础(3) 1.1节.用FlexBuilder创建Flex项目 1.2节.用FlexBuilder创建Flex库项目 1.3节.创建ActionScript项目 1.4节.在FlexBuilder中设置MXML编译器选项 1.5节.在FlexBuilder外部编译Flex...

    flex 测试写的一些demo集合

    flash端报错统一处理,重力特效和商品图片加入购物车的动画效果,flex 渲染器,修改标题栏皮肤,ShareObject,State切换

    Flex提取等值线—在线上直接显示数值

    Flex的显示能力跟颜色渲染能力带来的体验也比图片显示的效果要强很多。此范例使用第二种方法来实现。没有添加复杂的文字显示样式和风格,单纯从功能上加以实现。相信读者一定能自行设计出绚丽的数值显示。

    vue-layout-diy:基于vue和flex的自定义布局

    若使用插件的形式,s-empty在dev模式下渲染正常,在buid模式下无法渲染。 在main.js中通过Vue.component直接注册则正常。 为了方便在GithubPage展示效果,将build后dist中的结果拷贝至demo目录,并修改资源路径。 ...

    fleximage:Rails插件,用于将图像上传为资源,并支持调整大小,标记文本和其他特殊效果

    Fleximage是一个Rails插件,试图使图像上传和渲染变得非常容易。 简化Rails图像处理涉及2个方面。 1.图片上传 在本文的Rails 2资源驱动世界中,Fleximage认为图像应直接属于记录。 因此,您只需告诉模型类充当...

    基于Vue的细粒度交通时空大数据分析系统源码.zip

    基于Vue的细粒度交通时空大数据分析系统源码.zip 细粒度交通时空大数据分析系统 Neusoft traffic time and space big data analysis system 前言 ...动态排行榜,丰富的动画效果,实时的数据展示

    table-grid:使用显示的简单CSS网格系统

    表格网格 迄今为止,每个网格都使用float或某些inline-block黑客。 那是2013年,现在已经是2014年了,我们需要更新,更快,更... 上次听说flex-box渲染效果很差,因为浏览器必须做很多重新粉刷才能支持它。 我没有提到

    open flash char2 操作文当

    我们不仅可以免费使用,而且还可以修改源代码,来达到我们想要的效果。客户端在得到数据以后,在Flash Player中渲染出报表图。 目前通用的OFC版本为2 Lug Wyrm Charmer,使用actionscript3.0编写,Adobe Flex编译。 ...

    [Flash.ActionScript.3.0动画教程

    2.5.5 事件侦听器与处理函数 2.5.6 动画事件 2.6 显示列表 2.7 用户交互 2.7.1 鼠标事件 2.7.2 鼠标位置 2.7.3 键盘事件 2.7.4 键码 2.8 小结 第3章 三角学应用 3.1 什么是三角学(Trigonometry) 3.2 角 3.2.1 弧度制...

    css入门笔记

    5.尺寸与边框 1.单位 1.尺寸单位 1.px 像素 1024*768 2.in 英寸 1in=2.54cm 3.pt 磅 (1pt=1/72in) 4.cm 厘米 5.mm 毫米 6.em 相对父元素乘以倍数 7.rem 相对于根元素(html,body)乘以倍数 8.% 相对单位...

    webpack-store:Webpack+Vue多页面购物商城模板

    项目模板效果:在线预览:项目描述静态页面是用的阿里团队的rem和flex弹性布局。商城的数据是用axios请求本地的JSON文件,再用Vue进行渲染。项目放在github,乐于交流,欢迎starwebpack文档webpack.config.jsconst path...

    小程序实现多选框功能

    实现的原理也非常的简单,数据渲染到列表,绑定事件修改列表项的checked属性,不建议直接操作data的数据,当要操作的时候可以定义一个局部变量,局部操作完成后,在赋值给data,利用数据双向绑定的特性,就完成所有...

    wxapp_starbucks-仿星巴克微信小程序.zip

    -- wx:for 渲染列表 并判断高亮事件--&gt;   wx:for="{{carts}}" class="{{item.num&gt;0?'green':'gifts-box'}}"&gt;  &lt;!-- 跳转礼品卡详情页--&gt;   class="gifts-content" url="../giftcard/giftcard...

Global site tag (gtag.js) - Google Analytics