package classes.gustavo.ui.scrollItem.menuList
{
	
	import flash.display.MovieClip;
	
	public class MenuList extends MovieClip 
	{
		
		
		private var total		:		int;
		private var container	:		MovieClip;
		private var alturaItens	:		Number;
		
		private var itens		:		Array;
		
		private var id			:		int;
		
		public function MenuList()
		{
			super();
			
			container = _container;
			
		}
		
		public function init(_total:int,_alturaItens:Number):void
		{
			
			total 			= _total;
			alturaItens		= _alturaItens;
			
			listMenu();
			
			return void;
		}
		
		private function listMenu():void
		{
			
			itens	= [];
			
			var item:Item;
		
			for(var i:int=0; i<total; i++)
			{
				item 				= new Item();
				
				item.setText		= (i+1).toString();
				item.setId			= i;
				
				item.resize(alturaItens);
				item.y 				= i*(alturaItens+1);
				
				container.addChild(item);
				
				itens.push(item);
			}
		
		
		}
		
		public function close():void
		{
			
		}
		
		public function resize(_alturaItens:Number):void
		{
			alturaItens = _alturaItens;
			
			for(var i:int=0; i<total; i++)
			{
				itens[i].resize(alturaItens);
				itens[i].y 	= i*(alturaItens+1);
			}
			
		}
		
		
		public function get getId():int
		{
		    return id;
		}
		
		public function get getItens():Array
		{
			return itens;
		}
		
		public function get getContainer():MovieClip
		{
		   return container;
		}
					
		
	
	}//end class
}