flash on 2010-11-21

by aruerula
♥0 | Line 26 | Modified 2010-11-21 08:43:28 | MIT License
play

ActionScript3 source code

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

package {
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    public class Main extends Sprite {
        public function Main() {
            
            var sp:Sprite = new Sprite();
            sp.graphics.beginFill(0xcccccc);
            sp.graphics.drawCircle(0,0,30);
            sp.x = sp.width;
            sp.y = sp.height;
            sp.graphics.endFill();
            addChild(sp);
            addEventListener(MouseEvent.ROLL_OVER,rollOver);
            addEventListener(MouseEvent.ROLL_OUT,rollOut);

        }
        
        public function rollOver(event:Event):void{
            var sp:Sprite = event.target.sp;
            sp.scaleY = sp.scaleX = 1.5;
            
        }
        
        public function rollOut(event:Event):void{
            var sp:Sprite = event.target.sp;
            sp.scaleY = sp.scaleX = 1.0;
        }


    }
}