这段是注入txt文本就是需要抽奖人的名单列表:UserList.txt ,中奖名单列表:Save.txt
第一帧代码:
System.useCodepage = true
var UserList:String = ""
var AwardUsers:String = ""
var nowAwardUser:String = ""
var Users:Array
var Users1:Array=new Array()
var Users2:Array=new Array()
var lv:LoadVars = new LoadVars()
var lvs:LoadVars = new LoadVars()
lv.onData = function(s) {
if (s !== undefined) {
UserList = s
Users = UserList.split("\r\n")
for (var i = 0i<Users.lengthi++) {
var infos:Array = Users[i].split(" ")
if (infos[2].toString() == "2") {
Users1.push(infos[0].toString()+" "+infos[1].toString())//能抽所有奖
}
Users2.push(infos[0].toString()+" "+infos[1].toString())//不能抽一等奖的人
}
}
}
lv.load("UserList.txt")
lvs.onData = function(s) {
if (s !== undefined) {
AwardUsers = s
}
}
lvs.load("fscommand/Save.txt")
点击停得代码:我只给出一二等奖的三等奖的和着差不多
on (release) {
var AwardUser:String = ""
//for (var i = 0i<random(Users.length-1)i++) {
var intlength:Number
if (a == "一") {
intlength = random(Users1.length-1)
AwardUser = Users1[intlength].toString()
for(var i=0i<Users2.lengthi++){
if(Users[i].toString()==Users1[intlength].toString()){
Users2.splice(i,1)
}
}
Users1.splice(intlength,1)//移除已经出现过的人员
} else if (a == "二") {
intlength = random(Users2.length-1)
AwardUser = Users2[intlength].toString()
for (var i = 0i<Users1.lengthi++) {
if (Users1[i].toString() == Users2[intlength].toString()) {
Users1.splice(i,1)
}
}
Users2.splice(intlength,1)//移除已经出现过的人员
}
//}
a1.text = AwardUser
var nowdate:Date = new Date()
var year:Number = nowdate.getFullYear()//年
var month:Number = nowdate.getMonth()+1//月
var date:Number = nowdate.getDate()//日
var hours:Number = nowdate.getHours()//小时
var minutes:Number = nowdate.getMinutes()//分钟
var seconds:Number = nowdate.getSeconds()//秒
var datetime:String = year+"-"+month+"-"+date+" "+hours+":"+minutes+":"+seconds
var nowif:String = ""
if (a == "一") {
nowif = AwardUser+" 一等奖 "+datetime+"\r\n"
} else if (a == "二") {
nowif = AwardUser+" 二等奖 "+datetime+"\r\n"
}
nowAwardUser = nowAwardUser+nowif
System.setClipboard(AwardUsers+nowAwardUser)
fscommand("exec", "bcwj.exe")
//t2.text = random(9)
//t3.text = random(9)
//t4.text = random(9)
play()
}
至于你说的那个数字滚动效果没做,我看代码比较麻烦就没写,我滚动用的随机滚动影片剪辑
就是自己用姓名分开,做几个影片剪辑有效果,比用代码用的好,而且没那么卡,很实用。
希望能帮到你。
jquery实现立体式数字滚动条增加效果,代码分为两部分,一部分位html结构另一部分属于js代码段,需要的朋友参考下吧!1、html结构
<div class="numberRun1"></div>
2、js
<script type="text/javascript" src="js/digital_over.js" ></script>//引用 //这是自定义函数(需要在页面中进行调用) <script> //数字滚动function digitalScroll(obj,n){ var numRun = $(obj).numberAnimate({num:n, speed:2000, symbol:","}) var nums = n setInterval(function(){numRun.resetData(nums) },3000) var numWidth= $(obj).width() $(obj).find('.mt-number-animate').css('width',numWidth) $(obj).css('width','100%') $(obj).find('.mt-number-animate').css('margin','0 auto') }window.indexdigitalScroll=function(){ digitalScroll($('.numberRun1'),1160518) } </script> <!--这是在页面中调用的方法--> <script> $(function(){ indexdigitalScroll() }) </script>
3、图片案例