package com.guru.display.progressBar
{
	import com.guru.call.ICall;
	import com.guru.display.Text;
	import com.guru.panel.PanelBase;
	import flash.display.MovieClip;
	/**
	 * ...
	 * @author Eddy Lee
	 */
	public class GuruProgressBar extends PanelBase
	{
		private var mProgress_mc:MovieClip;
		private var mPercentage_mc:MovieClip;
		private var mPercentageText:Text;
		private var mCurrentPercentage_num:Number;
		
		public function GuruProgressBar(pName_str:String, pTimeline_mc:MovieClip)
		{
			super(pName_str, pTimeline_mc);
			
			mProgress_mc = mContent_mc.progress_mc;
			mPercentage_mc = mContent_mc.percentage_mc;
			mPercentageText = new Text(mPercentage_mc);
			
			this.reset();
		}
		
		public function reset():void
		{
			mProgress_mc.gotoAndStop(0);
			this.updateProgress(0);
		}
		
		public function updateProgress(pPercentage_num:Number):void
		{
			mCurrentPercentage_num = pPercentage_num;
			mProgress_mc.gotoAndStop(Math.max(mCurrentPercentage_num, mProgress_mc.currentFrame));
		}
		
		override public function showPanel(pDoneCall:ICall = null, pData_obj:Object = null):void 
		{
			this.reset();
			super.showPanel(pDoneCall, pData_obj);
		}
		
		override protected function onPanelShowDone(pDoneCall:ICall = null):void 
		{
			super.onPanelShowDone(pDoneCall);
		}
		
		override protected function onPanelHideDone(pDoneCall:ICall = null):void 
		{
			super.onPanelHideDone(pDoneCall);
		}
		
	}

}