Flash教程:制作幸运大抽奖程序
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-07
er(MouseEvent.MOUSE_DOWN,onMouse_Click); this["Ball"+i].addEventListener(MouseEvent.MOUSE_OUT,onMouse_Click); //...... } chakan_mc.buttonMode=true; chakan_mc.mouseChildren=false; chakan_mc.addEventListener(MouseEvent.MOUSE_OVER,onMouse_Click); chakan_mc.addEventListener(MouseEvent.MOUSE_DOWN,onMouse_Click); chakan_mc.addEventListener(MouseEvent.MOUSE_OUT,onMouse_Click); functiononMouse_Click(sxl:MouseEvent){ vartarget:MovieClip=sxl.currentTargetasMovieClip; vartarget_name:String=target.name.substr(0,1); switch(sxl.type){ case"mouseOver": mousw_over_sound.play(); switch(target_name){ case"B": getBitmapFilter(target); break; case"c": setTxtColor(target.t,0xFFFFFF); break; } break; case"mouseOut": switch(target_name){ case"B": target.filters=null; break; case"c": setTxtColor(target.t,0xFFFF00); break; } break; case"mouseDown": switch(target_name){ case"B": dele_balls_seleabled(); target.removeEventListener(MouseEvent.CLICK,onMouse_Click); target.gotoAndStop("two"); setTxtColor(target._txt); varindex:String=target.i; hit_ball_array.push(target); varstr:uint=uint(target.name.substr(4)); if(str<9){ gong_mc.Ball._txt.text="0"+uint(str+1); }else{ gong_mc.Ball._txt.text=""+uint(str+1); } gong_mc._txt.text=gong_array[index]; gong_mc.addEventListener(Event.ENTER_FRAME,move_gong_mc_rect); rect_up_sound.play(); msg_mc["m"+index].ball_mc.play(); msg_mc["m"+index].t.text=gong_array[index]; setTxtColor(msg_mc["m"+index].t,0xffff00); setTxtColor(msg_mc["m"+index].ball_mc._txt); break; case"c": target.t.text="移开中奖结果"; if(Math.abs(gong_mc.y-300)<10){ move_gong_mc=false; gong_mc.addEventListener(Event.ENTER_FRAME,move_gong_mc_rect); } move_msg_mc=!move_msg_mc; msg_mc.addEventListener(Event.ENTER_FRAME,show_msg_mc); rect_up_sound.play(); break; } break; } } // functionshow_msg_mc(sxl:Event){ if(move_msg_mc){ vardis_up:Number=(354-sxl.target.x)/5; sxl.target.x+=dis_up; if(Math.abs(dis_up)<1){ sxl.target.x=354; sxl.target.removeEventListener(Event.ENTER_FRAME,show_msg_mc); } }else{ vardis_down:Number=(1800-sxl.target.x)/5; sxl.target.x+=dis_down; if(Math.abs(dis_down)<10){ chakan_mc.t.text="查看中奖结果"; sxl.target.x=-1000; sxl.target.removeEventListener(Event.ENTER_FRAME,show_msg_mc); } } } //删除所有数字按钮功能 functiondele_balls_seleabled(){ for(vari:uint=0;i<Balls.length;i++){ varA:MovieClip=Balls; A.buttonMode=false; A.removeEventListener(MouseEvent.MOUSE_OVER,onMouse_Click); A.removeEventListener(MouseEvent.MOUSE_DOWN,onMouse_Click); A.removeEventListener(MouseEvent.MOUSE_OUT,onMouse_Click); } } //启用可用数字按钮功能 functionshow_balls_seleabled(A_arr:Array,B_arr:Array){ varA_array:Array=A_arr,B_array:Array=B_arr; for(vari:uint=0;i<A_array.length;i++){ varA:MovieClip=A_array; A.buttonMode=true; A.mouseChildren=false; A.addEventListener(MouseEvent.MOUSE_OVER,onMouse_Click); A.addEventListener(MouseEvent.MOUSE_DOWN,onMouse_Click); A.addEventListener(MouseEvent.MOUSE_OUT,onMouse_Click); } for(varj:uint=0;j<B_array.length;j++){ varB:Mo |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Flash教程:制作幸运大抽奖程序的所有评论