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

	/**
	 * The CPMoviePauseEvent class describes the event object passed to the event listener when a captivate movie is paused
	 */
	public class CPMoviePauseEvent extends CaptivateEvent 
	{
	/**
		*  The <code>CPMoviePauseEvent.CPMOVIEPAUSEEVENT</code> constant defines the value of the
		*  <code>type</code> property of the event object for an <code>CPMoviePauseEvent</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>slideNumber</code></td><td>The slide number of the slide in which the movie is paused</td></tr>
		*     <tr><td><code>frameNumber</code></td><td>The frame number upon which the movie is paused</td></tr>
		*     <tr><td><code>userPause</code></td><td><code>true</code> if the pause was due to clicking the pause button on the playbar,<code>false</code> otherwise</td></tr>
		*     <tr><td><code>cancelable</code></td><td><code>false</code></td></tr>
		*	  </table>
		*  @eventType CPMoviePauseEvent	
		*/
		public static const CPMOVIEPAUSEEVENT:String = "CPMoviePauseEvent";
		/**
		* @private
		*/
		protected var m_FrameNumber:Number;
		/**
		* @private
		*/
		protected var m_SlideNumber:Number;
		/**
		* @private
		*/
		protected var m_UserPause:Boolean;
		/**
		* @private
		*/
		public function CPMoviePauseEvent(captivateVersion:String="",frameNumber:Number=0,
			slideNumber:Number=0,userPause:Boolean=false,cancelable:Boolean = false) 
		{
			super(CPMoviePauseEvent.CPMOVIEPAUSEEVENT,captivateVersion,cancelable);
			m_FrameNumber = frameNumber;
			m_SlideNumber = slideNumber;
			m_UserPause = userPause;
		}
		/**
		* @private
		*/
		public override function clone():Event
		{
			return new CPMoviePauseEvent(captivateVersion,frameNumber,slideNumber,userPause,cancelable);
		}
		/**
		* The frame number upon which the movie is paused
		*/
		public function get frameNumber():Number
		{
			return m_FrameNumber;
		}
		/**
		* The slide number of the slide in which the movie is paused
		*/
		public function get slideNumber():Number
		{
			return m_SlideNumber;
		}
		/**
		* <code>true</code> if the pause was due to clicking the pause button on the playbar,<code>false</code> otherwise
		*/
		public function get userPause():Boolean
		{
			return m_UserPause;
		}
		/**
		* @private
		*/
		public override function toString():String
		{
			return formatToString("CPMoviePauseEvent","type","bubbles","cancelable","eventPhase","captivateVersion","slideNumber","frameNumber","userPause");
		}
	}
}
