ButtonsControl.as

by Lúcio on July 4th, 2009
No notes
Syntax: ActionScript 3
Show lines - Hide lines - Show in textbox - Download
package
{
	import flash.utils.Dictionary;
 
	public final class ButtonsControl
	{
		private static var collection:Dictionary = new Dictionary();
 
		public function ButtonsControl()
		{
			throw new Error("não é possível criar uma instância desta classe");
		}
 
		public static function commute(button:SwitchButton):void
		{
			button.changeState("on");
 
			for(var i:Object in collection)
			{
				if(collection[i] != button.name)
				{
					i.changeState("off");
				}
			}
		}
 
		public static function addButton(button:SwitchButton):void
		{
			collection[button] = button.name;
		}
	}
}

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS