flash on 2012-9-14

by hemingway
♥0 | Line 43 | Modified 2012-09-15 03:07:34 | MIT License
play

ActionScript3 source code

/**
 * Copyright hemingway ( http://wonderfl.net/user/hemingway )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/lr2A
 */

package
{
    import flash.display.*;
    import flash.geom.*;
    
    [SWF(width = "1024", height = "768", frameRate="60", scaleMode = "SHOW_ALL", align="TOP_LEFT")]
    public class ParticleEngine extends Sprite
    {
        public var spr:Array = new Array();

        public var initCount:Number;
        
        public var S:Point = new Point;
        public var V:Point = new Point;
        public var D:Point = new Point;
        public var W:Point = new Point;
        
        public function ParticleEngine ()
        {
            S = new Point(1024 / 4, 768 / 3);
            
            initParticle();
        }
        
        public function initParticle ():void
        {
            
                for (var sprX:Number = 1; sprX <= S.x; sprX++)
                {
                    for (var sprY:Number = 1; sprY <= S.y; sprY++)
                    {
                    
                   
                    
                    spr[initCount] = new Sprite();
                    spr[initCount].graphics.beginFill(0x000000, 0.5);
                    spr[initCount].graphics.drawRect(S.x + 4, S.y + 4, 5, 5);
                    spr[initCount].graphics.endFill();

                    stage.addChild(spr[initCount]);
                    
                    ++initCount;
                    }
                }
    
        }   
        
        public function updateParticle ():void
        {
        }

        public function refreshDisplay ():void
        {
            if ( stage != null )
               { stage.invalidate() }
        }
    }
}