In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

今、僕に出来る炎
Get Adobe Flash player
by kuma360 04 Aug 2010
/**
 * Copyright kuma360 ( http://wonderfl.net/user/kuma360 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7788
 */

//今、僕に出来る炎
package 
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Graphics;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.filters.BlurFilter;
    import flash.filters.DisplacementMapFilter;
    import flash.geom.Matrix;
    import flash.geom.Point;
    import flash.geom.Rectangle;
    
    public class Main extends Sprite 
    {
        private var _B:BitmapData = new BitmapData ( 465 , 465 , false , 0 ) ;
        private var _C:Bitmap = new Bitmap ( _B ) ;
        
        private var _D:BitmapData = new BitmapData ( 465 , 465 , false , 0 ) ;
        private var _E:Bitmap = new Bitmap ( _D ) ;
        
        private var _F1:BitmapData = new BitmapData ( 100 , 100 , false , 0 ) ;
        private var _F2:BitmapData = new BitmapData ( 465 , 465 , false , 0 ) ;
        private var _dark:BitmapData = new BitmapData ( 465 , 465 , true , 0x80000000 ) ;
        private var _offset:Array = new Array ;
        
        public function Main():void {
            
            var M1:Matrix = new Matrix;
            var M2:Matrix = new Matrix;
            var M3:Matrix = new Matrix;
            var S:Sprite = new Sprite ;
            var G:Graphics = S.graphics ;
            
            
            
            addChild ( _C ) ;
            
            
            
            M1.scale ( 4.5 , 4.5 ) ;
            M2.createGradientBox ( 50 , 150 , 90 * Math.PI / 180 ) ;
            M3.translate ( 200 , 100 ) ;
            
            G.beginGradientFill ( "linear" , [ 0xC06000 , 0xFFD09F ] , [ .5 , 1 ] , [ 0 , 255 ] , M2 ) ;
            G.drawRect ( 0 , 0 , 50 , 150 ) ;
            G.endFill () ;
            
            
            
            _offset.push ( new Point ) ;
            _offset.push ( new Point ) ;
            _offset.push ( new Point ) ;
            _offset.push ( new Point ) ;
            
            
            
            addEventListener (
                Event.ENTER_FRAME ,
                function ():void {
                    
                    var C:Number = 0 ;
                    for each( var P:Point in _offset ) {
                        P.y += ++ C ;
                    }
                    
                    _F1.perlinNoise ( 10 , 10 , 4 , 0 , true , true , 3 , false , _offset ) ;
                    _F2.draw ( _F1 , M1 ) ;
                    
                    _D.fillRect ( _B.rect , 0 ) ;
                    _D.draw ( S , M3 ) ;
                    _E.filters = [
                        new DisplacementMapFilter ( _F2 , new Point , 1 , 2 , 120 , 200 ) ,
                        new BlurFilter( 3 , 3 , 6 ) 
                    ] ;
                    
                    _B.copyPixels ( _dark , _dark.rect , new Point ) ;
                    _B.draw ( _E , null , null , "add" ) ;
                    
                }
            ) ;
            
        }
        
    }
    
}