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

Partigenを使ってみる。

Partigenのテスト
どうやって使うんだこれ。
@author paq89
Get Adobe Flash player
by paq 13 Apr 2010
/**
 * Copyright paq ( http://wonderfl.net/user/paq )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ng4O
 */

package 
{
	import com.desuade.partigen.emitters.Emitter;
	import com.desuade.partigen.renderers.StandardRenderer;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * Partigenのテスト
	 * どうやって使うんだこれ。
	 * @author paq89
	 */
	[SWF(backgroundColor="0xFFFFFF", width=465, height=465, frameRate=60)]
	public class Main extends Sprite 
	{
		private var _renderer:StandardRenderer;
		private var _emitter:Emitter;
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			_renderer = new StandardRenderer(this);
			_emitter = new Emitter();
			_emitter.particle = CircleParticle;
			_emitter.renderer = _renderer;
			_emitter.eps = 10;
			_emitter.life = 2;
			_emitter.lifeSpread = 4;
			_emitter.controllers.particle.addTween('alpha').setSingleTween(1, '0', 0, '0');
			_emitter.controllers.particle.addTween('scale').setSingleTween(.2, '0', 1, '0');
			_emitter.controllers.particle.addTween('x').setSingleTween('0', '0', 300, '50', 'easeOutBounce');
			_emitter.controllers.particle.addTween('y').setSingleTween('0', '0', '465', '0');
			_emitter.start();
		}
		
	}
	
}

import flash.display.Sprite;

class CircleParticle extends Sprite
{
	public function CircleParticle()
	{
		super();
		graphics.beginFill(0x000000);
		graphics.drawCircle(0, 0, 20);
	}
}