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

縮小

Get Adobe Flash player
by Itikara 11 Feb 2010
    Embed
/**
 * Copyright Itikara ( http://wonderfl.net/user/Itikara )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/lbXL
 */

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

    [SWF(width= 400, height= 400, frameRate= 30)]
    public class FlashTest extends Sprite {
    		private var re:Sprite;
    		public function FlashTest() {
			graphics.lineStyle(1, 0x0);
			graphics.moveTo(0, 0);
			graphics.lineTo(400, 400);
			graphics.moveTo(400, 0);
			graphics.lineTo(0, 400);
			re = new Sprite();
			re.graphics.lineStyle(1, 0x0);
			re.graphics.beginFill(0xffffff);
			re.graphics.drawRect(-200, -200, 400, 400);
			re.graphics.endFill();
			re.x = 200;
			re.y = 200;
			addChild(re);
			addEventListener(Event.ENTER_FRAME, Sre);
        }

    		private function Sre(e:Event):void {
    			if (re.scaleX > 0) {
    				re.scaleX -= 0.01;
    				re.scaleY -= 0.01;
    			}
    			else
    			{
    				re.scaleX = 1;
    				re.scaleY = 1;
    			}
		}
    }
}