zoukankan      html  css  js  c++  java
  • Flex 4: 一个向左移动 像右移动的效果

    <?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/halo" 
                   width
    ="500" height="300">
        
    <s:layout>
            
    <s:BasicLayout/>
        
    </s:layout>

        
    <fx:Script>
            
    <![CDATA[
                protected function clickHandler(event:MouseEvent):void
                {
                    // TODO Auto-generated method stub
                    effect.end();
                    effect.xTo = test.x == 490 ? 200 : 490;
                    effect.play();
                }
            
    ]]>
        
    </fx:Script>

        
    <fx:Declarations>
            
    <!-- Place non-visual elements (e.g., services, value objects) here -->
            
    <s:Move id="effect" target="{test}"/>
        
        
    </fx:Declarations>
        
    <s:Border backgroundColor="0xff0000" backgroundAlpha="0.4" width="100%" height="100%">
            
    <s:layout><s:BasicLayout/></s:layout>
            
    <s:Panel id="test" title="我是移动的Panel" 
                     x
    ="200" y="5" width="290" height="290" 
                     backgroundColor
    ="0x00ff00"
                     click
    ="clickHandler(event)"/>
        
    </s:Border>
    </s:Application>
  • 相关阅读:
    第二周总结
    币值转换
    抓老鼠
    秋季学习总结
    第七周作业
    第六周作业
    2019年春季第五周
    2019年春季学期第四周作业
    2019年春季学期第三周作业
    2019年春季学期第二周作业
  • 原文地址:https://www.cnblogs.com/Fooo/p/1593711.html
Copyright © 2011-2022 走看看