﻿// Copyright 2007. Adobe Systems Incorporated. All Rights Reserved.
package com.adobe.captivate.events 
{
	import flash.events.Event;
	import com.adobe.captivate.widgets.CPSlideProperties;

	/**
	 * The CPSlideExitEvent class describes the event object passed to the event listener when a slide starts playing
	 */
	public class CPSlideEnterEvent extends CaptivateEvent 
	{
		/**
		*  The <code>CPSlideEnterEvent.CPSLIDEENTEREVENT</code> constant defines the value of the
		*  <code>type</code> property of the event object for an <code>CPSlideEnterEvent</code> event.
		*  <p>The properties of the event object have the following values:</p>
		*  <table class="innertable">
		*     <tr><th>Property</th><th>Value</th></tr>
		*     <tr><td><code>bubbles</code></td><td><code>true</code></td></tr>
		*     <tr><td><code>frameNumber</code></td><td>The frame number at which the slide has started playing</td></tr>
		*     <tr><td><code>slideNumber</code></td><td>The index of the slide that has started playing( index is 1 based)</td></tr>
		*     <tr><td><code>slideLabel</code></td><td>The slide label of the slide that has started playing</td></tr>
		*     <tr><td><code>slideProperties</code></td><td>The slide properties of the slide that has started playing</td></tr>
		*     <tr><td><code>cancelable</code></td><td><code>false</code></td></tr>
		*	  </table>
		*  @eventType CPSlideEnterEvent	
		*/
		public static const CPSLIDEENTEREVENT:String = "CPSlideEnterEvent";
		/**
		* @private
		*/
		protected var m_FrameNumber:Number;
		/**
		* @private
		*/
		protected var m_SlideNumber:Number;
		/**
		* @private
		*/
		protected var m_SlideLabel:String;
		/**
		* @private
		*/
		protected var m_SlideProperties:CPSlideProperties;

		/**	
		* @private
		*/
		public function CPSlideEnterEvent(captivateVersion:String="",frameNumber:Number=0,slideNumber:Number=0,slideLabel:String="",
			slideProperties:CPSlideProperties=null,cancelable:Boolean = false) 
		{
			super(CPSlideEnterEvent.CPSLIDEENTEREVENT,captivateVersion,cancelable);
			m_FrameNumber = frameNumber;
			m_SlideNumber = slideNumber;
			m_SlideLabel = slideLabel;
			m_SlideProperties = slideProperties;
		}
		/**
		* @private
		*/
		public override function clone():Event
		{
			return new CPSlideEnterEvent(captivateVersion,frameNumber,slideNumber,slideLabel,slideProperties,cancelable);
		}
		
		/** 
		* The frame number at which the slide has started playing
		*/
		public function get frameNumber():Number
		{
			return m_FrameNumber;
		}
		/** 
		* The index of the slide that has started playing( index is 1 based)
		*/
		public function get slideNumber():Number
		{
			return m_SlideNumber;
		}
		/** 
		* The slide label of the slide that has started playing
		*/
		public function get slideLabel():String
		{
			return m_SlideLabel;
		}
		/** 
		* The slide properties of the slide that has started playing
		* @see com.adobe.captivate.widgets.CPSlideProperties
		*/
		public function get slideProperties():CPSlideProperties
		{
			return m_SlideProperties;
		}
		/**
		* @private
		*/
		public override function toString():String
		{
			return formatToString("CPSlideEnterEvent","type","bubbles","cancelable","eventPhase","captivateVersion","slideNumber","frameNumber","slideLabel","slideProperties");
		}
	}
}
