flex3 开门效果


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:eff="com.adobe.ac.mxeffects.*"
paddingBottom="0" paddingLeft="0" paddingTop="0" paddingRight="0"
horizontalAlign="center" verticalAlign="middle" xmlns="*" viewSourceURL="srcview/index.html">

<mx:Script>
<![CDATA[
import com.adobe.ac.mxeffects.Gate;
import com.adobe.ac.mxeffects.Flip;
import mx.effects.Sequence;
import mx.effects.Parallel;
import mx.effects.Resize;
import mx.effects.Fade;
import mx.effects.Iris;
import com.adobe.ac.mxeffects.DistortionConstants;

private const min_width:int = 350;
private const min_height:int = 200;

public function gotoChatRoom() : void {
var mySequence:Sequence = new Sequence();

var gate:Gate = new Gate(login);
gate.siblings = [ chatRoom ];
gate.direction = DistortionConstants.LEFT;
gate.smooth = true;
gate.distortion = 10;
gate.mode = Gate.OPEN;
gate.duration = 1000;
mySequence.addChild(gate);

var parallel:Parallel = new Parallel();
var resize:Resize = new Resize();
resize.target = loginStack;
resize.widthTo = this.width-20;
resize.heightTo = this.height-20;
resize.duration = 1000;
parallel.addChild(resize);

resize = new Resize();
resize.target = chatRoom;
resize.widthTo = this.width-20;
resize.heightTo = this.height-20;
resize.duration = 1000;
parallel.addChild(resize);
mySequence.addChild(parallel);

mySequence.play();
}

public function gotoLogin() : void {
var mySequence:Sequence = new Sequence();

var gate:Gate = new Gate(chatRoom);
gate.siblings = [ login ];
gate.direction = DistortionConstants.LEFT;
gate.smooth = true;
gate.distortion = 10;
gate.mode = Gate.CLOSE;
gate.duration = 1000;
mySequence.addChild(gate);

var parallel:Parallel = new Parallel();
var resize:Resize = new Resize();
resize.target = loginStack;
resize.widthTo = min_width;
resize.heightTo = min_height;
resize.duration = 1000;
parallel.addChild(resize);

resize = new Resize();
resize.target = chatRoom;
resize.widthTo = min_width;
resize.heightTo = min_height;
resize.duration = 1000;
parallel.addChild(resize);
mySequence.addChild(parallel);

mySequence.play();
}
]]>

</mx:Script>

<mx:Style source="/assets/OSX.css"/>

<mx:VBox>
<mx:ViewStack id="loginStack" width="350" height="200">
<mx:Panel id="login" title="Login" horizontalAlign="center"
verticalAlign="middle" backgroundColor="0xAAAAAA" >
<mx:Form >
<mx:FormItem label="Username">
<mx:TextInput id="userName" />
</mx:FormItem>
<mx:FormItem label="Password">
<mx:TextInput displayAsPassword="true" id="password"
enter="gotoChatRoom();"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Login" click="gotoChatRoom();" />
</mx:FormItem>
</mx:Form>
</mx:Panel>

<mx:Panel id="chatRoom" title="Chat Room" >
<mx:VBox width="100%" height="100%">
<mx:TextArea id="log" fontSize="12" width="100%" height="100%"
editable="false" />
</mx:VBox>
<mx:ControlBar>
<mx:TextInput id="msg" width="100%" fontSize="12" enter=""/>
<mx:Button label="Send" click="" />
<mx:Button label="Logout" click="gotoLogin()" />
</mx:ControlBar>
</mx:Panel>
</mx:ViewStack>
</mx:VBox>

</mx:Application>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值