SVG Test2

by flabaka
  前回に続きSVGのテスト
♥0 | Line 27 | Modified 2009-05-23 13:22:56 | MIT License
play

ActionScript3 source code

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

/*
*  前回に続きSVGのテスト
*/

package{
	import flash.display.Sprite;
	import frocessing.shape.FShapeSVG;
	import caurina.transitions.Tweener;  
	import flash.utils.Timer;  
	import flash.events.TimerEvent;  
	import caurina.transitions.properties.ColorShortcuts;  

	public class SVGTest5 extends Sprite{

		private var sp:Sprite = new Sprite();
                private  var timer:Timer = new Timer(2000);  
                ColorShortcuts.init();

		public function SVGTest5(){
				var svg:XML =
								<svg>
										<polygon fill="#FFFFFF" stroke="#000000" stroke-width="5" points="52.925,5.649 67.62,35.423 100.478,40.198 76.702,63.375 82.315,96.1 52.925,80.649 23.536,96.1 29.149,63.375 5.373,40.198 38.23,35.423 "/>
								</svg>;
				var shapedata:FShapeSVG = new FShapeSVG(svg);
				sp = shapedata.toSprite();
				addChild(sp);
				timer.start();
				timer.addEventListener(TimerEvent.TIMER,timerHandler); 
		};
		private function timerHandler(e:TimerEvent):void{
			Tweener.addTween(sp, {x:Math.floor(Math.random()*400),y:Math.floor(Math.random()*325),time:1,_color:Math.floor(Math.random()* 0xFFFFFF)})
		} 
	}
}