点击触发图片滤镜

Posted on 2013-08-07 21:35  诸葛小北  阅读(213)  评论(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()"
               >
   <s:layout>
       <s:VerticalLayout paddingLeft="20" paddingTop="20" />
   </s:layout>
    <fx:Script>
        
        <![CDATA[
            
            protected function moveButton(event:MouseEvent):void
            {
                movebutton.x = movebutton.x +100;
                movebutton.y = movebutton.y +100;
                moveLable.text = movebutton.x+" - "+ movebutton.y ;
                
            }
            
        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:GlowFilter id="glow" blurX="20" blurY="20" color="#4e7800"/>
        <s:AnimateFilter id="effect" target="{image}" bitmapFilter="{glow}"/>
    </fx:Declarations>
    <s:BitmapImage id="image" source="@Embed('assets/warning.gif')"/>
    <s:Button id="mybutton" label="点击" click="effect.play()"/>
    <s:Button id="movebutton" label="移动"  click="moveButton(event)"/>
    <s:Label text="a" id="moveLable" />
</s:Application> 

 

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