Flex窗体操作代码事例_第1页
Flex窗体操作代码事例_第2页
Flex窗体操作代码事例_第3页
Flex窗体操作代码事例_第4页
Flex窗体操作代码事例_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、package viewimport flash.display.*;import flash.events.TimerEvent;import flash.utils.*; import mx.containers.*;import mx.containers.Panel;import mx.controls.*;import mx.core.Application;import mx.core.UIComponent;import mx.effects.Blur;import mx.effects.Iris;import mx.effects.Move;import mx.eff

2、ects.Parallel;import mx.effects.Resize;import mx.effects.Rotate;import mx.effects.Sequence;import mx.effects.Zoom;import mx.effects.easing.Bounce;import mx.events.DropdownEvent;import mx.events.EffectEvent;import mx.managers.PopUpManager; import ponents.BorderContainer;import ponents.DataGrid;i

3、mport ponents.Group;import spark.effects.Fade;import spark.effects.Rotate3D;import spark.effects.Scale; public class ViewActionprivate static var _width:Number=mx.core.Application.application.width;private static var _height:Number=mx.core.Application.application.height; public static var

4、originalX:Number=0;public static var originalY:Number=310; public static var syOriginalX:Number=(_width/2)-(550/2);public static var syOriginalY:Number=_height-350; public static var fOriginalX:Number=0;public static var fOriginalY:Number=10; public static var cOriginalX:Number=860;pu

5、blic static var cOriginalY:Number=110; private static var originalWidth:Number = 550;private static var originalHeight:Number = 350;  private static var originalWidthpb:Number = 800;private static var originalHeightpb:Number = 600; private static var originalWidthlb:Number = 933;

6、private static var originalHeightlb:Number = 435; private static var xOffset:Number;private static var yOffset:Number; private static var jlX:Number;private static var jlY:Number;private static var jlWidth:Number;private static var jlHeight:Number;  /* * 窗口最小化 * */public static f

7、unction viewSX(bc:BorderContainer,vHeight:Number):void/bc.visible=false;var p:Parallel = new Parallel();var m:Move = new Move(bc);m.xTo = 290;m.yTo = _height-25-400+100;var r:Resize = new Resize(bc);r.widthTo = 110;r.heightTo = 25;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 5

8、00;p.play(); /bcnTitle.visible=true;jlX = bc.x;jlY = bc.y;jlWidth = bc.width;jlHeight = bc.height;  /* * 标题最大化 * */public static function titleFD(bc:BorderContainer,vWidth:Number,vHeight:Number):void var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Res

9、ize(bc);m.xTo=jlX;m.yTo=jlY;r.widthTo = jlWidth;r.heightTo = jlHeight;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();  /点击放大图片时放大public static function viewFD(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):voidif(bc.width>=_width-300)img.sou

10、rce="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc);m.xTo=originalX;m.yTo=originalY;r.widthTo = originalWidth;r.heightTo = originalHeight;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.pl

11、ay();elseimg.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);move.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;parallel.addChild(move);para

12、llel.addChild(resize);parallel.duration = 500;parallel.play();/点击放大图片时放大public static function viewFD2(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):void/缩小if(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = ne

13、w Move(bc);var r:Resize = new Resize(bc); m.xTo=syOriginalX;m.yTo=syOriginalY;r.widthTo = originalWidth;r.heightTo = originalHeight;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();else/放大img.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel =

14、 new Parallel(); var move:Move = new Move(bc);move.xTo = 0;move.yTo = 100;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height-100;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play();/* * 打开窗口动画

15、 * */public static function viewOpen(bc:BorderContainer):voidvar m:Fade = new Fade(bc);m.alphaTo=1;m.alphaFrom=0.1;m.duration=1500;m.play();/* * 关闭窗口动画 * */public static function viewClose(bc:BorderContainer):voidvar m:Fade = new Fade(bc);m.alphaTo=0;m.alphaFrom=1;m.duration=1500;ti=m.playheadTime;m

16、.play();private static var ti:Number;public static function viewClose1(bc:BorderContainer):voidvar m:Fade = new Fade(bc);m.alphaTo=0;m.alphaFrom=1;m.duration=1000;ti=m.playheadTime;m.play();/点击放大图片时放大public static function viewFirstFD(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):void/最

17、小化if(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc);m.xTo=fOriginalX;m.yTo=fOriginalY;r.widthTo = 300;r.heightTo = 300;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.du

18、ration = 500;p.play(); else/最大化img.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);move.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;p

19、arallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play(); /点击放大图片时放大public static function viewCLGJFD(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):void/最小化if(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1.png"var p:Para

20、llel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc);m.xTo=cOriginalX;m.yTo=cOriginalY;r.widthTo = 270;r.heightTo = 300;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();else/最大化img.source="CountryGrid/Image/Menu/hy.png"var parallel:P

21、arallel = new Parallel();var move:Move = new Move(bc);move.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play();/* * 打开窗口动画 *

22、 */public static function openView(bc:BorderContainer):voidvar p:Parallel = new Parallel();var m:Move = new Move(bc);m.xTo = 0;m.yTo = 0;m.duration=2000;var r:Resize = new Resize(bc);r.widthTo = 400;r.heightTo =300;r.duration=2000;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.play(); 

23、;/为危险点编写,可通用public static function viewReizeWindow(bc:BorderContainer,mainWidht:Number,mainHeight:Number,img:Image):voidif(bc.width>=_width-mainWidht)/最小化img.source="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc

24、);m.xTo=fOriginalX;m.yTo=fOriginalY;r.widthTo = mainWidht;r.heightTo = mainHeight;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();else/最大化img.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);move.xTo

25、= 0;move.yTo = 5;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play();/点击放大图片时放大public static function viewFD1(bc:BorderContainer,vWidth:Number,vHe

26、ight:Number,img:Image):voidif(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc);m.xTo=fOriginalX;m.yTo=fOriginalY;r.widthTo = originalWidth;r.heightTo = originalHeight;r.hideChildre

27、nTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();elseimg.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);move.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_heig

28、ht;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play(); /public static function viewFD3(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):voidif(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1

29、.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc);m.xTo=fOriginalX;m.yTo=fOriginalY;r.widthTo = originalWidthpb;r.heightTo = originalHeightpb;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();elseimg.source="CountryG

30、rid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);move.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.dur

31、ation = 500;parallel.play(); /public static function viewFD4(bc:BorderContainer,vWidth:Number,vHeight:Number,img:Image):voidif(bc.width>=_width-300)img.source="CountryGrid/Image/Menu/fangda1.png"var p:Parallel = new Parallel();var m:Move = new Move(bc);var r:Resize = new Resize(bc)

32、;m.xTo=fOriginalX;m.yTo=fOriginalY;r.widthTo = originalWidthlb;r.heightTo = originalHeightlb;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play();elseimg.source="CountryGrid/Image/Menu/hy.png"var parallel:Parallel = new Parallel();var move:Move = new Move(bc);mo

33、ve.xTo = 0;move.yTo = 10;var resize:Resize = new Resize(bc);resize.widthTo = _width;resize.heightTo =_height;resize.hideChildrenTargets = bc;parallel.addChild(move);parallel.addChild(resize);parallel.duration = 500;parallel.play(); /* * 窗口最小化动画 * */public static function viewSX1(bc:TitleWindow,

34、vHeight:Number):void/bc.visible=false;var p:Parallel = new Parallel();var m:Move = new Move(bc);m.xTo = 290;m.yTo = _height-25-400+100;var r:Resize = new Resize(bc);r.widthTo = 110;r.heightTo = 25;r.hideChildrenTargets = bc;p.addChild(m);p.addChild(r);p.duration = 500;p.play(); /bcnTitle.visible=true;jlX = bc.x;jlY = bc.y;jl

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论