Flex 滚动新闻,跳转,二级联动菜单,颜色特效
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="complete(),success(),initApp(),init(),init1(),init2()"> <mx:Script> <![CDATA[ private function complete():void { move_up.yFrom = cs.height - 6; //"加6减6是为了首尾连接更加自然" move_up.yTo = 0 - tt.height + 6; //同上 move_up.repeatCount = 0; //无限次重复 move_up.repeatDelay = 0; //重复时间,毫秒 move_up.duration = 6000; //滚动一次的时间,毫秒 move_up.play(); } private function move_pause():void { move_up.pause(); //暂停 } private function move_resume():void { move_up.resume(); //从暂停位置开始 } private function success():void { move_up1.yFrom = ca.height - 6; //"加6减6是为了首尾连接更加自然" move_up1.yTo = 0 - aa.height + 6; //同上 move_up1.repeatCount = 0; //无限次重复 move_up1.repeatDelay = 0; //重复时间,毫秒 move_up1.duration = 6000; //滚动一次的时间,毫秒 move_up1.play(); } private function move_pause1():void { move_up1.pause(); //暂停 } private function move_resume1():void { move_up1.resume(); //从暂停位置开始 } public function initApp():void { var url:String = "http://www.imust.cn"; var request:URLRequest = new URLRequest(url); //navigateToURL(request,'_self'); // 在当前页面跳转 navigateToURL(request,'_blank'); // 新窗口 } public function init():void { var url:String = "http://www.baidu.com"; var request:URLRequest = new URLRequest(url); //navigateToURL(request,'_self'); // 在当前页面跳转 navigateToURL(request,'_blank'); // 新窗口 } public function init1():void { var url:String = "http://www.sina.com"; var request:URLRequest = new URLRequest(url); //navigateToURL(request,'_self'); // 在当前页面跳转 navigateToURL(request,'_blank'); // 新窗口 } public function init2():void { var url:String = "http://www.tom.com"; var request:URLRequest = new URLRequest(url); //navigateToURL(request,'_self'); // 在当前页面跳转 navigateToURL(request,'_blank'); // 新窗口 } ]]> </mx:Script> <mx:XML id="dp" source="student_grade.xml" format="e4x" /> <mx:Move id="move_up" target="{tt}" /> <mx:Move id="move_up1" target="{aa}" /> <mx:Panel width="250" height="458" layout="absolute" title="公告栏" fontSize="13" horizontalCenter="0" verticalCenter="0"> <mx:VBox height="100%" width="100%"> <mx:Canvas id="cs" width="100%" height="59" verticalScrollPolicy="off" mouseOver="move_pause()" mouseOut="move_resume()"> <mx:Text id="tt" width="94%" horizontalCenter="0" text="Varyall Javaeye 社区Web欢迎您的到来!" verticalCenter="0" click="init1()"> </mx:Text> <!--<mx:Text id="bb" width="94%" text="欢迎光临Varyall Javaeye的店面,谢谢大家的捧场!" x="4" y="77"/>--> </mx:Canvas> <mx:Canvas id="ca" verticalScrollPolicy="off" mouseOver="move_pause1()" mouseOut="move_resume1()" width="100%" height="34"> <mx:Text id="aa" width="94%" horizontalCenter="0" text="欢迎光临Varyall Javaeye的店面,谢谢大家的捧场!" verticalCenter="0" click="init2()"/> </mx:Canvas> <mx:Button label="Flex 颜色特效 内蒙古科技大学" width="220" fillColors="[white,halogreen,blue,haloblue]" themeColor="black" fillAlphas="[1.0, 1.0]" click="initApp()"/> <mx:Button label="Flex 的颜色特效 百度" width="220" fillColors="[white,halogreen,blue,haloblue]" themeColor="black" fillAlphas="[1.0, 1.0]" click="init()"/> <mx:Label text="这是省级的"/> <mx:ComboBox fillColors="[white,halogreen,blue,haloblue]" themeColor="black" fillAlphas="[1.0, 1.0]" id="student" dataProvider="{dp.student}" labelField="@name" width="160"></mx:ComboBox> <mx:Label text="这是市级的"/> <mx:ComboBox fillColors="[white,halogreen,blue,haloblue]" themeColor="black" fillAlphas="[1.0, 1.0]" id="grade" dataProvider="{student.selectedItem.grade}" width="160"></mx:ComboBox> </mx:VBox> </mx:Panel> </mx:Application>