spark下_3D两扇门特效

 

1.      实现方法

Ø  将DistortionEffects.swc文件拷贝到lib文件夹中

Ø  引入需要用到的类库xmlns:mxeffects="com.adobe.ac.mxeffects.*"

Ø  创建实体类并设置属性

var e :Gate  = new Gate( one );

             e.siblings = [ two ]; 

             e.mode="OPEN";         播放的方式

             e.direction="LEFT"

             e.duration = 1500;

            e.play();

 

2.源代码

<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                       xmlns:s="library://ns.adobe.com/flex/spark"

                       xmlns:mx="library://ns.adobe.com/flex/mx"

                       xmlns:_3dcomp="_3dcomp.*"

                       xmlns:mxeffects="com.adobe.ac.mxeffects.*"

                       width="466" height="370">

   

    <fx:Script>

        <![CDATA[

            import com.adobe.ac.mxeffects.Door;

            import com.adobe.ac.mxeffects.Gate;

 

           

            protected function login1_changeHandler(event:Event):void

            {

                var e :Gate  = new Gate( one );

                e.siblings = [ two ];

                e.mode="OPEN";

                e.direction="LEFT"

                e.duration = 1500;

                e.play();

            }

            protected function regi1_changeHandler(event:Event):void

            {

                var e : Gate = new Gate( two );

                e.siblings = [ one ];

                e.mode="CLOSE";

                e.direction="LEFT"

                e.duration = 1500;

                e.play();  

            }

        ]]>

    </fx:Script>

   

    <mx:ViewStack id="viewstack1" width="322" height="300" horizontalCenter="0" verticalCenter="0">

       

        <s:NavigatorContent width="100%" height="100%" label="视图 1"  id="one">

            <s:Panel left="5" right="5" top="5" bottom="5" title="http://blog.csdn.net/fly_air.com">

                <s:Button bottom="20" label="按钮" horizontalCenter="0" click="login1_changeHandler(event)"/>

                <s:Label fontSize="25" fontWeight="bold" horizontalCenter="0" text="第一个"

                         verticalCenter="0"/>

            </s:Panel>

        </s:NavigatorContent>

       

       

        <s:NavigatorContent width="100%" height="100%" label="er" id="two">

            <s:Panel left="5" right="5" top="5" bottom="5" title="http://blog.csdn.net/fly_air.com">

                <s:Button bottom="20" label="按钮" horizontalCenter="0" click="regi1_changeHandler(event)"/>

                <s:Label fontSize="25" fontWeight="bold" horizontalCenter="0" text="第二个"

                         verticalCenter="0"/>

            </s:Panel>

        </s:NavigatorContent>

    </mx:ViewStack>

</s:WindowedApplication>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值