简单的火焰效果及图示原理(as3.0)

//========================   code   ========================
package{
  
import flash.display.*;
import flash.ui.Mouse;
import flash.events.*;
import flash.filters.* ;
import flash.geom.*;
public class main extends Sprite{
   private var __bmd:BitmapData;
   private var __bm:Bitmap;
   private var __bf:BlurFilter;
   private var __asfox_mc:MovieClip;
   private var __cmf:ColorMatrixFilter;
   public function main(){
    __init();
    __initEvt();
  }
private function __init():void{
     stage.frameRate = 35;
           Mouse.hide();
     __bmd= new BitmapData(550,400,true,0x000000)
           __bm=new Bitmap(__bmd);
           addChild(__bm);
    
           __bf=new BlurFilter(7,10,3)
           __asfox_mc=new asfox();
           __asfox_mc.scaleX =0.4
           __asfox_mc.scaleY =0.4
           addChild(__asfox_mc);
    
     __cmf=new ColorMatrixFilter([1,0,0,0,0,
          0,1,0,0,0,
          0,0,1,0,0,
          0,0,0,0.8,0]);
   }
   private function __initEvt():void{
    stage.addEventListener(MouseEvent.MOUSE_MOVE, __onMouseMove);
       addEventListener(Event.ENTER_FRAME, __loop);
   }
  
   private  function __loop(evt:Event):void{

   __bmd.draw(this);
   __bmd.applyFilter(__bmd,__bmd.rect,new Point(0,0),__bf);
   __bmd.applyFilter(__bmd,__bmd.rect,new Point(0,0),__cmf);
   __bmd.scroll(0,-6);
   }
    private function __onMouseMove(evt:MouseEvent):void{
     __asfox_mc.x=evt.stageX
     __asfox_mc.y=evt.stageY
    }
}
}

阅读更多
文章标签: Flash UI
个人分类: actionscript
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭