flash 随机函数
Math.floor(Math.random()*4); 随机产生一个0-4的随机数 下载fla文件下载swf文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
go_btn.addEventListener(MouseEvent.CLICK, augur);
function augur(me:MouseEvent){
    var rnd=Math.floor(Math.random()*4);
      
    if (rnd==0){
        msg_txt.text="^O^ 万事大利!";
    }else if (rnd==1){
        msg_txt.text="^_^ 喜气临门!";
    }else if (rnd==2){
        msg_txt.text="出入平安!";
    }else if (rnd==3){
        msg_txt.text="运势平平!";
    }
}




转载于:https://www.cnblogs.com/babyhhcsy/archive/2013/01/03/2842950.html

相关文章:

  • 2021-12-09
  • 2021-12-09
  • 2021-12-24
  • 2021-07-20
  • 2021-09-26
  • 2021-05-29
  • 2021-09-02
  • 2022-02-07
猜你喜欢
  • 2022-02-22
  • 2021-10-08
  • 2021-11-15
  • 2021-12-16
  • 2022-03-01
相关资源
相似解决方案