flash on 2014-7-14

by 0hhaaaa
♥0 | Line 24 | Modified 2014-07-14 16:48:30 | MIT License
play

ActionScript3 source code

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

package {
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    
    public class BitmapTest extends Sprite
    {
        public var bmpData:BitmapData;
        public var bmp:Bitmap;
        
        public function BitmapTest():void
        {
            bmpData = new BitmapData(stage.stageWidth,stage.stageHeight,false,0xFF0000);
            bmp = new Bitmap(bmpData);
            bmp.x = stage.stageWidth/2;
            bmp.y = stage.stageHeight/2;
            addChild(bmp);
            stage.addEventListener(Event.ENTER_FRAME,_rotate);
        }
        
        public function _rotate(e:Event):void
        {
            bmp.rotation = 360*Math.random();
        }
    }
}