flash on 2010-2-16

by gaina
ActionScript3.0アニメーションから、練習用
♥0 | Line 31 | Modified 2010-02-17 00:31:46 | MIT License
play

ActionScript3 source code

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

//ActionScript3.0アニメーションから、練習用
package {
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.geom.PerspectiveProjection;
	import flash.geom.Point;
	
	[SWF(backgroundColor=0x000000)]
	public class test3D extends Sprite{
		private var _shape:Shape;
		
		public function test3D(){
			stage.align=StageAlign.TOP_LEFT;
			stage.scaleMode=StageScaleMode.NO_SCALE;
			
			_shape=new Shape();
			_shape.graphics.beginFill(0xffffff);
			_shape.graphics.drawRect(-100,-100,200,200);
                     _shape.graphics.endFill();
			_shape.x=stage.stageWidth/2;
			_shape.y=stage.stageHeight/2;
			_shape.z=-50;
			addChild(_shape);
			addEventListener(Event.ENTER_FRAME,onEnterFrame);
		}
			
		private function onEnterFrame(event:Event):void{
			_shape.rotationY+=2;
			_shape.rotationZ+=1;
                     _shape.z+=2;
		}
	}
}