flash on 2014-1-28

by aiz
♥0 | Line 36 | Modified 2014-01-28 21:45:00 | MIT License
play

ActionScript3 source code

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

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 MyFirestAnimation(){
             _circle = new Circle(10);
             _circle.alpha = 0.25;
             _circle.vx = 3;
             _circle.vy = 4;
             _cricle.x = 465 / 2;
             _cricle.y = 465 / 2;
             addChild(_cirlcle);
             accEventListener(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 = 0x000000) {
         
         graphics.beginFill(_fillColor);
         graphics.drawCircle(0, 0, _radius);
         graphics.endFill();
         radius = _radius;
     }
     public function move():void {
         x+= vx;
         y+= vy;
     }
 }

Forked