flash on 2010-4-14

by kihon
♥0 | Line 20 | Modified 2010-04-14 01:12:52 | MIT License
play

ActionScript3 source code

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

package
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import com.bit101.components.IndicatorLight;
 
 
	public class Main extends Sprite
	{
		private var light:IndicatorLight;
 
		public function Main()
		{
			light = new IndicatorLight(this, 0, 0, 0xFF9900, "light");
 
			light.addEventListener(MouseEvent.CLICK, onMouseClick);
		}
 
		private function onMouseClick(event:MouseEvent):void
		{
			if (light.isFlashing) light.isLit = false;
			else light.flash(300);
		}
	}
}