package classes.matuto.particles
{
	import classes.matuto.interfaces.IDisplay;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	public class ParticlePhoto extends MovieClip implements IDisplay
	{
		
		
		private var total		:int;
		private var movie		:MovieClip;
		public  var pecas		:Array;

		public function ParticlePhoto(_movie:MovieClip,
										_total:int=10)
		{
			
			super();
			
			movie			= _movie;
			total 			= _total;
			
			initList();
		
		}
		
		private function initList():void
		{

			pecas = [];
			
			var bitsmaps:Array;
			
			for(var i:int=0; i<movie.numChildren; i++)
			{		
				
				var item:MovieClip 		= movie.getChildAt(i) as MovieClip;
			
				bitsmaps = [];
				
				for(var j:int=0; j<total; j++)
				{
					var bitmap			:Bitmap;
					var bitmapdata		:BitmapData;
					bitmapdata 			= new BitmapData(item.width,item.height,true,16777215);
					bitmap				= new Bitmap(bitmapdata);
					bitmapdata.draw(item);
					bitmap.visible = false;
					item.addChildAt(bitmap,j+1);					
					bitsmaps.push(bitmap);	
				}
				
				item.removeChildAt(0);
				pecas.push(bitsmaps);
				
			}
			
		}
		
		
		public function init():void
		{			
			
			
			
		}
		
		public function close():void
		{
		}
		
		public function resize():void
		{
		}
		
		public function dispose():void
		{
			
		}
		
		
	}//end class
}