zoukankan      html  css  js  c++  java
  • 飘雪效果的swf

    //第一帧动作
    import flash.events.Event;
    
                
      for(var k:int=0;k<90;k++)
     {
       var xuehua:xue= new xue();
             xuehua.alpha = Math.random()+.3; 
                xuehua.height = xuehua.width = Math.random()*6+5;
             xuehua.x=Math.random()*550;
          xuehua.y=Math.random()*400;
             piaoxuekongjian.addChild(xuehua); 
     }
       
    
    addEventListener(Event.ENTER_FRAME,webcyz);
    
    function webcyz(e:Event)
    {
     for(var k:int;k<3;k++)
     {
         var xuehua:xue= new xue();
         xuehua.alpha = Math.random()+.3; 
            xuehua.height = xuehua.width = Math.random()*6+5;
         xuehua.x=Math.random()*550;
         piaoxuekongjian.addChild(xuehua);        
     }
     //trace(piaoxuekongjian.numChildren);
     
      for(var i:int=0;i<piaoxuekongjian.numChildren;i++)
      {
    
       var mc:xue = xue(piaoxuekongjian.getChildAt(i));
       
       
       if(mc.y>400)
       {
       piaoxuekongjian.removeChild(mc);
       i--;      
       }
       else
       {
         mc.y+=Math.random()*6;
         mc.x+=(Math.random()-.5)*5;
       }
       
      }
     
    }

    //项目库中雪花的子类

    package  {
     
     import flash.display.MovieClip;
     
     
     public class xue extends MovieClip {
      
      
      public function xue() {
       // constructor code
      }
     }
     
    }

    cs6源代码

  • 相关阅读:
    安卓获取双IMEI
    NodeJS异步、同步 创建多层文件夹
    Winfrom 控件名称缩写
    Unobtrusive Ajax
    ID 为 17608的进程当前未运行
    欢迎
    路由
    VS快捷键
    Test
    并查集与带权并查集---由浅入深
  • 原文地址:https://www.cnblogs.com/webcyz/p/5769768.html
Copyright © 2011-2022 走看看