宜昌本地软件开发与弱电工程服务商
项目咨询 · 快速响应
您当前的位置: > 博客2 > AS2与AS3技术

[AS3]随机抽取手机号码的应用示例(随机抽取13,15号段任意号码)

2016-10-13 00:16:48 点击量:9 标签: 收藏本文

[AS3]随机抽取手机号码的应用示例(随机抽取13,15号段任意号码)

  1. //by johnny 2008.4.26  
  2. package{  
  3.  import flash.display.Sprite;  
  4.  import flash.events.MouseEvent;  
  5.  import flash.text.TextField;  
  6.  import flash.events.Event;  
  7.   public class tel_num extends Sprite{  
  8.    var start_bt:Sprite=new Sprite();  
  9.    var stop_bt:Sprite=new Sprite();  
  10.    var show_num:TextField=new TextField();  
  11.    var my_num35:Array=new Array("3","5");     
  12.   public function tel_num(start_bt,stop_bt){  
  13.    addEventListener(Event.ENTER_FRAME, show_u);  
  14.    start_bt.addEventListener(MouseEvent.MOUSE_DOWN, start_num);     
  15.    stop_bt.addEventListener(MouseEvent.MOUSE_DOWN, stop_num);     
  16.    addChild(show_num);  
  17.   }    
  18.   public function start_num(event:Event){     
  19.    addEventListener(Event.ENTER_FRAME, show_u);     
  20.   }    
  21.   public function stop_num(event:Event){     
  22.    removeEventListener(Event.ENTER_FRAME, show_u);     
  23.   }    
  24.   public function show_u(event:Event){      
  25.      show_num.text ="1"+my_num35[String(int(Math.random()*2))]  
  26.       for(var i:Number=1;i<10;i++){  
  27.       show_num.appendText(String(int(Math.random()*10)));  
  28.        }  
  29.    show_num.x=180;  
  30.    show_num.y=200;  
  31.    show_num.textColor=0xFF0000;  
  32.    show_num.height=20;  
  33.    show_num.scaleX=3;  
  34.    show_num.scaleY=3;  
  35.   }  
  36.   }  
  37.   }  

 

ABOUT US
宜昌农人网络科技有限公司

我们是一家提供综合软件外包与弱电工程服务的技术公司。

业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。

公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室