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

flash on 2011-4-22

Get Adobe Flash player
by hdkzykym 22 Apr 2011
    Embed
/**
 * Copyright hdkzykym ( http://wonderfl.net/user/hdkzykym )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7Pno
 */

package {
    import flash.events.Event;
    import flash.display.Sprite;
   
    public class FlashTest extends Sprite {
        
        private var conteiner:Array = new Array();
        private var circle:Sprite;
        
        private var num:Number = 30;
        
        public function FlashTest (){
            
            for(var i:int = 0;i<num;i++){
            circle = new Sprite();
            circle.graphics.beginFill(0x000000);
            circle.graphics.drawCircle(0,0,3);
            circle.graphics.endFill();
            addChild(circle);
            buttonMode = true;
            circle.x = stage.stageWidth/2;
            circle.y = stage.stageHeight/2;
            conteiner.push(circle);
            }
            
            addEventListener(Event.ENTER_FRAME,enterFrame);
            
        }
        
        private function enterFrame(e:Event):void{
                     
            conteiner[0].x = stage.stageWidth - 3;
                        
            for(var i:int = 1;i<conteiner.length;i++){
            conteiner[i].x += (conteiner[i - 1].x - conteiner[i].x)/4;
            conteiner[i].y += (conteiner[i - 1].y - conteiner[i].y)/4;
            conteiner[i].alpha = (num-i)/num ;
            }
        }
    }
}