已阅读5页,还剩14页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
个人总结flex各种用法 var x:Number=Capabilities.screenResolutionX; var y:Number=Capabilities.screenResolutionY; Alert.show(x=+x+y=+y); 第二种方法 Alert.show(stage.fullScreenWidth+=+stage.fullScreenHeight); /获得stage(工作区)的宽、高 Alert.show(stage.stageWidth+=+stage.stageHeight); /读取xml文件private function readxml2():void var urlrequest:URLRequest=new URLRequest(file/stu.xml); var urlloader:URLLoader=new URLLoader(urlrequest); urlloader.addEventListener(Event.PLETE,pletehandler); private function pletehandler(event:Event):void var xml:XML=new XML(event.target.data); /var arr:Array=new Array(xml); this.dg.dataProvider=xml.children(); this.tree.dataProvider=xml; this.cb.dataProvider=xml.children(); /this.hlist.dataProvider=xml.children(); /flex获得系统路径 var add:String=ExternalInterface.call(window.location.href.toString,1); Alert.show(add); /背景颜色不断变化 private function changeBG():void var mytime:Timer=new Timer(2000); mytime.addEventListener(TimerEvent.TIMER,changHandle); mytime.start(); private function changHandle(e:TimerEvent):void this.setStyle(backgroundColor,Math.random()*0xffffff); /获得键盘按下的键的值 public function getCode():void btn.addEventListener(KeyboardEvent.KEY_DOWN,keyHandle); function keyHandle(event:KeyboardEvent):void Alert.show(你按下了:+String.fromCharCode(event.charCode); /动态加载不同界面 import mont.Two; import mont.One; var t:Two=new Two(); var o:One=new One(); private function showOne():void tw.removeAllChildren(); tw.addChild(o); private function showTwo():void tw.removeAllChildren(); tw.addChild(t); /flex绑定图片 Bindable Embed(source=img/1.jpg) public var phone1:Class; /日期中文标题 mx:DateChooser id=dtchoosex=219y=83dayNames=日,一,二,三,四,五,六monthNames=一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月change=disDate()minYear=xx/ /选择日期dateChoose function disDate():void txtDate.text=fm.format(dtchoose.selectedDate.toLocaleDateString(); /flex中添加html标记 mx:TextArea id=textcreationComplete=init()width=248height=59 mx:htmlText !CDATA input type=file/ a href=你哈!/a /mx:htmlText /mx:TextArea /flex带下划线的链接 this.lblLink.htmlText=a href=target=_blank新闻/a;mx:Label x=524y=393text=Hellollllid=lblLinkrollOver=focusManager.deactivate()color=blueopaqueBackground=#ffffff rollOut=focusManager.activate()styleName=Label creationComplete=link()/.Labeltext-roll-over-color:red;text-decoration:underline;background-color:green;font-size:12px;text-selected-color:red; /flex转向URL Var url:URLRequest=new URLRequest(); navigateToURL(url,_self);/在本页打开 navigateToURL(url,_blank);/在新的一页打开 /弹出对话框-非模式打开- PopUpManager.createPopUp(this,类(界面)的名称); -模式打开- var ep:Main=new Main(); PopUpManager.addPopUp(ep,this,true);/界面,打开窗口父类,是否模式 PopUpManager.centerPopUp(ep);/在父类窗口居中 /-Alert的用法 public function test():void var glow:GlowFilter=new GlowFilter(); glow.color=StyleManager.getColorName(blue);/边框颜色 glow.strength=5; glow.alpha=0.8; var alert:Alert=Alert.show(是否选择,提示,Alert.YES|Alert.NO,this,alertHandle); alert.filters=glow; private function alertHandle(event:CloseEvent):void if(event.detail=Alert.YES) lbl.text=是; else lbl.text=否; mx:Button x=62y=80label=Buttonclick=test()/ mx:Label x=62y=37text=Labelwidth=65id=lbl/ /flex Combobox添加请选择- private function loadCB() var arr:Array=new Array(-请选择-); for(var i:int=1;i 10;i+) arri=i; this.cb.dataProvider=arr; /bobox选择的值和下标 private function selected():void Alert.show(cb.selectedItem.toString()+下标:+cb.selectedIndex); mx:ComboBox x=194y=80id=cbcreationComplete=loadCB()change=selected() /鼠标移动变大,Button加图片,变手型 mx:Button x=72y=80label=Buttonclick=test()mouseMove=changBig()mouseOut=changSmall()id=btnheight=52icon=Embed(source=img/3.jpg) labelPlacement=bottomwidth=67useHandCursor=truebuttonMode=true/ private function changBig():void this.btn.scaleX=1.5; this.btn.scaleY=1.5 private function changSmall():void this.btn.scaleX=1; this.btn.scaleY=1; /flex panel拖动效果 mx:Panel x=194y=125width=192height=121layout=absoluteid=panelmouseDown=ondragStart(event)mouseUp=ondragStop(event) /mx:Panel private function ondragStart(event:MouseEvent):void Panel(event.target).startDrag(); private function ondragStop(event:MouseEvent):void Panel(event.target).stopDrag(); /写入共享数据 share=SharedObject.getLocal(username); share.data.userName=txtUser.text; share.flush(); /读取共享数据 var share:SharedObject=SharedObject.getLocal(username); Alert.show(share.data.userName); /jsp/html文件嵌入到flex中(需要把flexiframe.swc放在项目的flex_libs下) Application标签内xmlns:code=mx:HDividedBox x=0y=10width=100%height=500 mx:Panel width=30%height=500layout=absolute /mx:Panel mx:Panel width=70%height=500layout=absolute code:IFrame id=frmsource=file/万年历.htmlheight=100%width=100%/!-这是最重要的- /mx:Panel /mx:HDividedBox /检查使用的操作系统 private function checkOS():void var os:String=Capabilities.os; tt.text=你的操作系统是:-+os; /检查所使用的浏览器 private function checkPlay():void var play:String=Capabilities.playerType; Alert.show(play); if(play=ActiveX) tt.text=你的浏览器是-IE; else if(play=PlugIn) tt.text=你的浏览器是-Mozilla-Firefox; else tt.text=你的浏览器是-其他; /检查player的版本和使用的语言 private function other(
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年湖南怀化市人社局所属事业单位招聘工作人员参考题库附答案详解(完整版)
- 2025年湖南怀化市人社局所属事业单位招聘工作人员参考题库有答案详解
- 2025广西中共崇左市委宣传部招聘编外聘用人员1人参考题库含答案详解(完整版)
- 小小探险家的奇幻之旅冒险类想象作文12篇
- 2025年石油化工行业石油石化产业发展与精细化工生产研究报告及未来发展趋势
- 2025年生物科技行业生物药物研发中基因工程技术应用案例研究报告及未来发展趋势预测
- 2025年体育健身行业运动科技应用研究报告及未来发展趋势
- 2025年幼儿园教师廉洁从教承诺书
- 2025年教育行业AI教育技术在学习中的应用研究报告及未来发展趋势
- 财务收支合法合规承诺书3篇
- 关于畜禽交易管理办法
- 神经内科眩晕病例讨论课件
- 管制刀具班会课件
- JG/T 528-2017建筑装饰装修材料挥发性有机物释放率测试方法-测试舱法
- 林火监测与预警课件
- 会计中级职称《财务管理》电子书
- 学生学业成绩分析与进步跟踪表
- 2025年驾驶证资格考试科目一必刷题库及答案(共420题)
- 体育场馆羽毛球馆运营策略考核试卷
- 国开公共部门人力资源管理自检自测1-九
- 红旗河工程可行性报告
评论
0/150
提交评论