日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

我的第一个Flex Project

發布時間:2025/6/15 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 我的第一个Flex Project 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我的第一個Flex成品,費了不少勁,總算出來了,和初學的朋友們分享一下,其中一定有許多是做了無用功了,如果有老鳥前來指導,那更多謝了。

是在Eclipse下做的,在bin-debug里確實有一個同名的swf,可打開卻什么都沒有,不知何故。總之在Eclipse下運行是沒問題的。

<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><mx:TitleWindow x="0" y="0" width="437" height="328" layout="absolute" title="Secondblood" creationComplete="changePic()"><mx:Button label="" x="10" y="26" styleName="myCustomButton" width="50" height="50" id="cs1" click="Button_click(1)"/><mx:Button label="" x="10" y="142" styleName="myCustomButton" width="50" height="50" id="cs15" click="Button_click(15)"/><mx:Button label="" x="358.5" y="84" styleName="myCustomButton" width="50" height="50" id="cs14" click="Button_click(14)"/><mx:Button label="" x="300.5" y="142" styleName="myCustomButton" width="50" height="50" id="cs20" click="Button_click(20)"/><mx:Button label="" x="300.5" y="84" styleName="myCustomButton" width="50" height="50" id="cs13" click="Button_click(13)"/><mx:Button label="" x="242.5" y="84" styleName="myCustomButton" width="50" height="50" id="cs12" click="Button_click(12)"/><mx:Button label="" x="184" y="84" styleName="myCustomButton" width="50" height="50" id="cs11" click="Button_click(11)"/><mx:Button label="" x="126" y="84" styleName="myCustomButton" width="50" height="50" id="cs10" click="Button_click(10)"/><mx:Button label="" x="68" y="84" styleName="myCustomButton" width="50" height="50" id="cs9" click="Button_click(9)"/><mx:Button label="" x="10" y="84" styleName="myCustomButton" width="50" height="50" id="cs8" click="Button_click(8)"/><mx:Button label="" x="242" y="142" styleName="myCustomButton" width="50" height="50" id="cs19" click="Button_click(19)"/><mx:Button label="" x="184" y="142" styleName="myCustomButton" width="50" height="50" id="cs18" click="Button_click(18)"/><mx:Button label="" x="126" y="142" styleName="myCustomButton" width="50" height="50" id="cs17" click="Button_click(17)"/><mx:Button label="" x="68" y="142" styleName="myCustomButton" width="50" height="50" id="cs16" click="Button_click(16)"/><mx:Button label="" x="300.5" y="200" styleName="myCustomButton" width="50" height="50" id="cs27" click="Button_click(27)"/><mx:Button label="" x="242" y="200" styleName="myCustomButton" width="50" height="50" id="cs26" click="Button_click(26)"/><mx:Button label="" x="184" y="200" styleName="myCustomButton" width="50" height="50" id="cs25" click="Button_click(25)"/><mx:Button label="" x="126" y="200" styleName="myCustomButton" width="50" height="50" id="cs24" click="Button_click(24)"/><mx:Button label="" x="68" y="200" styleName="myCustomButton" width="50" height="50" id="cs23" click="Button_click(23)"/><mx:Button label="" x="359" y="200" styleName="myCustomButton" width="50" height="50" id="cs28" click="Button_click(28)"/><mx:Button label="" x="359" y="142" styleName="myCustomButton" width="50" height="50" id="cs21" click="Button_click(21)"/><mx:Button label="" x="10" y="200" styleName="myCustomButton" width="50" height="50" id="cs22" click="Button_click(22)"/><mx:Button label="" x="358" y="26" styleName="myCustomButton" width="50" height="50" id="cs7" click="Button_click(7)"/><mx:Button label="" x="300" y="26" styleName="myCustomButton" width="50" height="50" id="cs6" click="Button_click(6)"/><mx:Button label="" x="242" y="26" styleName="myCustomButton" width="50" height="50" id="cs5" click="Button_click(5)"/><mx:Button label="" x="184" y="26" styleName="myCustomButton" width="50" height="50" id="cs4" click="Button_click(4)"/><mx:Button label="" x="126" y="26" styleName="myCustomButton" width="50" height="50" id="cs3" click="Button_click(3)"/><mx:Button label="" x="68" y="26" styleName="myCustomButton" width="50" height="50" id="cs2" click="Button_click(2)"/></mx:TitleWindow> <mx:Style> .myCustomButton {overSkin:Embed(source="file:///D|/aa/Source/不出頭.jpg");upSkin:Embed(source="file:///D|/aa/Source/不出頭.jpg");downSkin:Embed(source="file:///D|/aa/Source/不出頭.jpg"); }.myButton1{overSkin:Embed(source="file:///D|/aa/Source/出頭.jpg");upSkin:Embed(source="file:///D|/aa/Source/出頭.jpg");downSkin:Embed(source="file:///D|/aa/Source/出頭.jpg"); }</mx:Style><mx:Script><![CDATA[import mx.controls.Alert;import mx.events.CloseEvent;static var cs_num:int=0;static var flag:int=15;var flag_time;var flag_again;var buttonArr:Array=new Array();//var buttonArray:Array=[cs1,cs2,cs3,cs4,cs5,cs6,cs7,cs8,cs9,cs10,cs11,cs12,cs13,cs14,cs15,cs16,cs17,cs18,cs19,cs20,cs21,cs22,cs23,cs24,cs25,cs26,cs27,cs28];public function changePic():void{buttonArr.push(cs1);buttonArr.push(cs2);buttonArr.push(cs3);buttonArr.push(cs4);buttonArr.push(cs5);buttonArr.push(cs6);buttonArr.push(cs7);buttonArr.push(cs8);buttonArr.push(cs9);buttonArr.push(cs10);buttonArr.push(cs11);buttonArr.push(cs12);buttonArr.push(cs13);buttonArr.push(cs14);buttonArr.push(cs15);buttonArr.push(cs16);buttonArr.push(cs17);buttonArr.push(cs18);buttonArr.push(cs19);buttonArr.push(cs20);buttonArr.push(cs21);buttonArr.push(cs22);buttonArr.push(cs23);buttonArr.push(cs24);buttonArr.push(cs25);buttonArr.push(cs26);buttonArr.push(cs27);buttonArr.push(cs28);flag_again=setInterval(time_change,5000);flag_time=setInterval(task,900);}function time_change():void{clearInterval(flag_time);if(flag>=0){var cd_time:int=flag*60;flag_time=setInterval(task,cd_time);//意思是隔cd_time毫秒執行一次 }flag--;}function task():void{var randomNum:int=Math.random()*28;if(Button(buttonArr[randomNum]).styleName=="myCustomButton"){Button(buttonArr[randomNum]).styleName="myButton1";cs_num++; }if(cs_num>=15){clearInterval(flag_time);clearInterval(flag_again);flag=1000;popAlert();}}function popAlert():void{ //修改Alert.YES和Alert.NO的顯示文本 Alert.yesLabel = "是"; Alert.noLabel = "否"; //彈出對話框設定顯示標題為“選擇對話框”,提示內容為“請選擇''是''或者''否''”,顯示Alert.YES和Alert.NO兩個按鈕 //設定關閉Alert對話框響應的事件,設定缺省按鈕為Alert.YES Alert.show("你輸了,再來一次?","選擇對話框",Alert.YES|Alert.NO,this,clickSelectHandler,null,1); }function clickSelectHandler(event:CloseEvent):void{ //得到用戶點擊的按鈕 if (event.detail==Alert.YES) {flag=15;cs_num=0;for(var i:int=0;i<buttonArr.length;i++){Button(buttonArr[i]).styleName="myCustomButton";}flag_again=setInterval(time_change,5000);flag_time=setInterval(task,900);}else exit(); } public function Button_click(n:int):void{if(buttonArr[n-1].styleName=="myButton1"){buttonArr[n-1].styleName="myCustomButton";cs_num--; }}]]></mx:Script></mx:WindowedApplication> 附上兩張圖片:

?

總結

以上是生活随笔為你收集整理的我的第一个Flex Project的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。