package com.guru.project.brother.inbox 
{
	import com.guru.call.FunctionCall;
	import com.guru.call.ICall;
	import com.guru.conn.ConnPath;
	import com.guru.facebookApplicationBase.gameBase.GameSectionBase;
	import com.guru.facebookApplicationBase.tracking.Tracking;
	import com.guru.project.brother.collection.galleryStep.CollectionSectionGalleryStep;
	import flash.display.MovieClip;
	/**
	 * ...
	 * @author Eddy Lee
	 */
	public class InboxSection extends GameSectionBase
	{
		private var mData_obj:Object;
		
		public function InboxSection(pTimeline_mc:MovieClip, pData_obj:Object = null)
		{
			super(pTimeline_mc);
			
			mData_obj = pData_obj;
			mStepClass_array = [CollectionSectionGalleryStep];
			
			this.gotoStep(0);
			
			Tracking.getInstance().track("InboxSection");
		}
		
		override protected function gotoStep3(e:*, pDoneCall:ICall = null, pData_obj:Object = null):void
		{
			mTimeline_mc.addFrameScript(mTimeline_mc.currentFrame - 1, null);
			
			if(mData_obj)
				mCurrentStep = new mStepClass_array[mTimeline_mc.currentFrame - 1](mTimeline_mc.step_mc, null, null, { path:ConnPath.getInboxPath(), cid:mData_obj["cid"] } );
			else
				mCurrentStep = new mStepClass_array[mTimeline_mc.currentFrame - 1](mTimeline_mc.step_mc, null, null, { path:ConnPath.getInboxPath() } );
				
			mCurrentStep.setNextStepCall(new FunctionCall(this, gotoStep, mTimeline_mc.currentFrame%mTimeline_mc.totalFrames));
			mCurrentStep.setPreviousStepCall(new FunctionCall(this, gotoStep, Math.max(0, mTimeline_mc.currentFrame - 2)));
			mCurrentStep.fadeIn(pDoneCall);
		}
		
	}

}