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

Simple Animation

Get Adobe Flash player
by Wataru.Miyazaki 15 Apr 2013
/**
 * Copyright Wataru.Miyazaki ( http://wonderfl.net/user/Wataru.Miyazaki )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/x4ap
 */

package {
    import flash.display.Sprite;
    import flash.events.Event;

    public class FlashTest extends Sprite {
        
        public var sampleView:Sprite;
        
        public function FlashTest() {
            // write as3 code here..
            
            sampleView = new Sprite();
            sampleView.graphics.lineStyle(10, 0x00aa00);
            sampleView.graphics.drawCircle(0, 0, 30);
            addChild(sampleView);
            
            addEventListener(Event.ENTER_FRAME, move);
            
        }
        
        private function move(e:Event):void {
         
            var sampleX:Number;
            sampleX = sampleView.x;
            if(sampleX<100 ){ 
                 sampleView.x = sampleView.x+1;
            }
            
        }
        
        
    }
}