
package classes.matuto.core
{
	
	
	/*
	
		Classe responsavel pelos botoes
		de navegacao do site, botoes do menu.
	
		autor: gustavo cosme
		data:  18/maio/2011
	
	*/
	
	
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class ButtonNav extends Sprite
	{
		
		public var params	: Object;
		private var url		: String; 
		private var id		: String; 
		
		public function ButtonNav()
		{
			
			params = new Object();
			enableButton();
			
		}
		
		
		public function enableButton() :void
		{
			
			this.buttonMode 	= true;
			this.mouseChildren 	= true;
			this.mouseEnabled  	= true;
			
			this.addEventListener("click", click_handle);
			this.addEventListener("rollOver", over_handle);
			this.addEventListener("rollOut", out_handle);
			
		}
		
		
		public function disableButton() :void
		{
			
			this.buttonMode 	= false;
			this.mouseChildren 	= false;
			this.mouseEnabled  	= false;
			
			this.removeEventListener("click", click_handle);
			this.removeEventListener("rollOver", over_handle);
			this.removeEventListener("rollOut", out_handle);
			
		}
		
		
		public function click_handle( event :MouseEvent = null ) :void
		{
			click();
		}
		
		
		
		public function over_handle( event :MouseEvent = null ) :void
		{	
			over();	
		}
		
		public function out_handle( event :MouseEvent = null ) :void
		{
			out();
		}
		
		
		public function click() :void
		{   	
			Matuto.SET_URL(url);
		}
		
		
		public function over() :void
		{
		}
		
		
		public function out() :void
		{
		}
		
		
		public function set enabled( bool :Boolean ) :void
		{
			this.mouseEnabled 	    = bool;
			
			if(bool)
			enableButton();
			else
			disableButton();
			
		}
		
		
		public function get enabled() :Boolean
		{
			return this.mouseEnabled;	
		}
		
		public function set setParams(_params:Object):void
		{
			params = _params;
		}
				
		public function get getParams():Object
		{
			return params;		
		}
		
		public function set setUrl(value:String):void
		{
			url = value;
		}
		
		public function set setId(value:String):void
		{
			id = value;
		}
		
		public function get getUrl():String
		{
			return url;
		}

		public function get getId():String
		{
			return id;
		}
		
		
	}//end class
	
}
