flash on 2016-6-20

by www0z0k
♥0 | Line 23 | Modified 2016-06-20 21:15:15 | MIT License
play

ActionScript3 source code

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

package {
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.display.Shape;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var _2draw:Shape = new Shape();
                _2draw.name = 'temp border';
                addChild(_2draw);
                _2draw.graphics.lineStyle(3, 0x545454, 1, true);
                //g.drawRoundRect((obj.width - 64) / 2, (obj.height - 64) / 2, 64, 64, 1, 1);
                _2draw.graphics.drawRoundRect(20, 20, 64, 64, 40, 40);
                
            stage.addEventListener(MouseEvent.CLICK, click);

        }
        
        private function click(e:MouseEvent):void{
            if(e.ctrlKey){
                scaleX = scaleY = 1;
            }else{
                scaleX += 0.01;
                scaleY += 0.01;
            }
      
        }

    }
}