flash on 2012-3-1

by MMMMMonchi
♥0 | Line 36 | Modified 2012-03-01 11:39:09 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.*;
    import flash.events.Event;
    [SWF(frameRate="30",width="465",height="465")]
    public class MyFirstAnimation extends Sprite{
        private var _circle:Circle;
        public function MyFirstAnimation(){
            _circle = new Circle(100,0x0000ff);
            _circle.alpha = 0.50;
            _circle.vy=3;
            _circle.vx=4;

            _circle.x=465/2;
            _circle.y=465/2;
            addChild(_circle);
       
        addEventListener(Event.ENTER_FRAME,enterFrameHandler);
        }
         private function enterFrameHandler(e:Event):void{
           _circle.move();    
        }
    }
}       
   import flash.display.Sprite;
   
   class Circle extends Sprite{
       public var vx:Number;
       public var vy:Number;

       
       public function Circle(_radius:Number, _fillColor:uint=0x0000ff){
           graphics.beginFill(_fillColor);
           graphics.drawCircle(0,0,_radius);
           graphics.endFill();

           }
       public function move():void{
           x+=vx;
           y+=vy;

           }
       
       }