<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>pipwerks</title>
	
	<link>http://pipwerks.com</link>
	<description>E-Learning and Web Development</description>
	<lastBuildDate>Mon, 30 Aug 2010 05:08:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/pipwerks" /><feedburner:info uri="pipwerks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-sa/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>pipwerks</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Complete List of Variables for Adobe Captivate 5</title>
		<link>http://feedproxy.google.com/~r/pipwerks/~3/rwXHU_GxEF0/</link>
		<comments>http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 05:40:49 +0000</pubDate>
		<dc:creator>philip</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Captivate]]></category>
		<category><![CDATA[Adobe Captivate Hacks]]></category>
		<category><![CDATA[CaptivateController]]></category>

		<guid isPermaLink="false">http://pipwerks.com/?p=1249</guid>
		<description><![CDATA[While updating my CaptivateController script I noticed there have been some changes to the Captivate variables available to Captivate developers. I figured I should document them for future reference.
Note that some variables available in CP3 and CP4 are no longer available. The following list should be exhaustive for CP5; variables for previous versions of Captivate [...]<p><a href="http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/">Complete List of Variables for Adobe Captivate 5</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>While <a href="http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/">updating my CaptivateController</a> script I noticed there have been some changes to the Captivate variables available to Captivate developers. I figured I should document them for future reference.</p>
<p>Note that some variables available in CP3 and CP4 are no longer available. The following list should be exhaustive for CP5; variables for previous versions of Captivate have been purposely left off this list. I also purposely left off some publicly accessible (but useless) movieclips and objects.</p>
<p>While most people seem to focus on using Captivate variables natively within a Captivate project via the Variables menu or widgets, my focus has been figuring out how accessible/usable they are via <em>JavaScript</em>. Thus you may find small differences between my list and other people&#8217;s lists, and differing opinions regarding the usefulness of some variables and publicly accessible movieclips. Regardless, the items below should be accessible via every method: widgets, JavaScript, and the native Variables support in Adobe Captivate.</p>
<p>If you know of any variables that I missed, please leave a comment. Thanks!</p>
<p class="note">Update: Kurt Melander has kindly <a href="http://lab.pipwerks.com/captivate/Captivate_5_Variables.pdf">converted this list to PDF format</a> if you&#8217;d like to download or print it. Thanks, Kurt.</p>
<table>
<tr>
<th>Variable</td>
<th>Type</td>
<th>Description    </tr>
<tr>
<td>
<p>CPMovieType</p>
</td>
<td> [number] </td>
<td>Informational variable. Indicates whether the queried SWF is a skin SWF (0) or the main content SWF (1).</td>
</tr>
<tr>
<td> CaptivateVersion </td>
<td> [string] </td>
<td>Informational variable. Indicates the version of Adobe Captivate that published the SWF</td>
</tr>
<tr>
<td> DoNotRegisterRightClickBecauseOfAggregator </td>
<td> [boolean] </td>
<td>Internal variable, no information available</td>
</tr>
<tr>
<td> LocalConnectionInUse </td>
<td> [boolean] </td>
<td>Internal variable, no information available</td>
</tr>
<tr>
<td> NoOfTOCEntries </td>
<td> [number] </td>
<td>Informational variable. Returns the number of items contained in the project&#8217;s Table of Contents</td>
</tr>
<tr>
<td>
<p>PlaybarProperties</p>
</td>
<td>
<p>[string]<br />
      in Chrome</p>
<p>[XML] in Firefox </p>
</td>
<td>
<p>Internal variable, no information available.</p>
<p>NOTE: This item is<br />
    :XML data type in AS3. Because browsers have different support for native XML data types, values returned from this variable should not be considered cross-browser. Use at your own risk.</p>
</td>
</tr>
<tr>
<td> __loadbase</td>
<td> [string] </td>
<td>
<p>Informational variable. Returns project&#8217;s root file path.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> contentHeight </td>
<td> [number] </td>
<td>Informational variable. Returns the height of the Captivate main SWF (in pixels)</td>
</tr>
<tr>
<td> contentLeft </td>
<td> [number] </td>
<td>Informational variable. Returns the distance of the Captivate main SWF from the leftmost edge of the project (in pixels).</td>
</tr>
<tr>
<td> contentSWF</td>
<td> [string] </td>
<td>
<p>Informational variable. Returns the file name for the project&#8217;s main SWF.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> contentTop </td>
<td> [number] </td>
<td>Informational variable. Returns the distance of the Captivate main SWF from the topmost edge of the project (in pixels).</td>
</tr>
<tr>
<td> contentWidth </td>
<td> [number] </td>
<td>Informational variable. Returns the width of the Captivate main SWF (in pixels)</td>
</tr>
<tr>
<td> cpAutoPlay </td>
<td> [boolean] </td>
<td>Informational variable. Indicates whether the project is set to auto-play.</td>
</tr>
<tr>
<td> cpCaptivateSkinSWF</td>
<td> [boolean] </td>
<td>
<p>Informational variable. Indicates whether the SWF is a skin SWF or primary project SWF.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> cpCmndCC </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will enable captioning. Setting to 0 will disable captioning.</td>
</tr>
<tr>
<td> cpCmndFastForward </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will  fast-forward the movie (play the movie at a higher framerate). Setting to 0 will return the movie to the normal playback speed.</td>
</tr>
<tr>
<td> cpCmndGotoFrameAndResume </td>
<td> [number] </td>
<td>
<p>Command variable. Will cause the movie to jump to the specified frame and resume playing (frame numbering begins at 0).</p>
<p>Note: frames are not the same as slides.</p>
</td>
</tr>
<tr>
<td> cpCmndGotoSlide </td>
<td> [number] </td>
<td>
<p>Command variable. Will cause the movie to jump to the specified slide (slide numbering starts at 0).</p>
<p>Note: frames are not the same as slides.</p>
</td>
</tr>
<tr>
<td> cpCmndMute </td>
<td> [boolean] </td>
<td>Command variable. Setting to 1 will disable (mute) the audio. Setting to 0 will restore it to normal.</td>
</tr>
<tr>
<td> cpCmndNext </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will cause the movie to jump to the next slide. Setting to 0 will do nothing.</td>
</tr>
<tr>
<td> cpCmndPlaybarMoved </td>
<td> [boolean] </td>
<td>Command variable. Internal variable. According to Captivate documentation, &quot;Set to 1 if the playbar has moved.&quot;</td>
</tr>
<tr>
<td> cpCmndShowPlaybar </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will cause the movie&#8217;s playbar to appear. Setting to 0 will make the palybar disappear.</td>
</tr>
<tr>
<td> cpCmndVolume </td>
<td> [number] </td>
<td>Command variable. Setting to a number will cause the volume to change. The volume ranges from 0 (muted) to 100 (maximum volume).</td>
</tr>
<tr>
<td> cpContentLoadStart</td>
<td> [boolean] </td>
<td>
<p>Informational variable. Indicates whether the main project SWF has started.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> cpContentLoaded</td>
<td> [boolean] </td>
<td>
<p>Informational variable. Indicates whether the main project SWF has loaded.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> cpContentPositioned </td>
<td></td>
<td>Internal variable. No information available.</td>
</tr>
<tr>
<td> cpContentScaled </td>
<td></td>
<td>Internal variable. No information available.</td>
</tr>
<tr>
<td> cpHasSkinSWF </td>
<td> [boolean] </td>
<td>Informational variable. Indicates whether the Captivate project uses an external skin.</td>
</tr>
<tr>
<td> cpInfoAuthor </td>
<td> [string] </td>
<td>Informational variable. Returns the project author&#8217;s name, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoCompany </td>
<td> [string] </td>
<td>Informational variable. Returns the project company&#8217;s name, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoCopyright </td>
<td> [number] </td>
<td>Informational variable. Returns the project&#8217;s copyright notice, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoCourseID </td>
<td> [number] </td>
<td>Informational variable. Returns the project&#8217;s course ID, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoCourseName </td>
<td> [string] </td>
<td>Informational variable. Returns the project&#8217;s course name, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoCurrentDate </td>
<td> [string] </td>
<td>Informational variable. Returns the day portion of the current date.</td>
</tr>
<tr>
<td> cpInfoCurrentDateString </td>
<td> [string] </td>
<td>Informational variable. Returns today&#8217;s date (US English format).</td>
</tr>
<tr>
<td> cpInfoCurrentDay </td>
<td> [string] </td>
<td>Informational variable. Returns number indicating day of week (1 = Sunday, 2 = Monday, etc.)</td>
</tr>
<tr>
<td> cpInfoCurrentHour </td>
<td> [string] </td>
<td>Informational variable. Returns the current hour (24 hour clock format).</td>
</tr>
<tr>
<td> cpInfoCurrentMinutes </td>
<td> [string] </td>
<td>Informational variable. Returns the minutes portion of the current time.</td>
</tr>
<tr>
<td> cpInfoCurrentMonth </td>
<td> [string] </td>
<td>Informational variable. Returns the month portion of the current date.</td>
</tr>
<tr>
<td> cpInfoCurrentSlide </td>
<td> [number] </td>
<td>Informational variable. Returns the current slide number. (Uses 1-based index)</td>
</tr>
<tr>
<td> cpInfoCurrentSlideLabel </td>
<td> [string] </td>
<td>Informational variable. Returns the slide label for the current slide, if available.</td>
</tr>
<tr>
<td> cpInfoCurrentSlideType </td>
<td> [string] </td>
<td>Informational variable. Returns the slide type for the current slide.</td>
</tr>
<tr>
<td> cpInfoCurrentTime </td>
<td> [string] </td>
<td>Informational variable. Returns the current time, including seconds (24 hour clock format).</td>
</tr>
<tr>
<td> cpInfoCurrentYear </td>
<td> [string] </td>
<td>Informational variable. Returns the year portion of the current date.</td>
</tr>
<tr>
<td> cpInfoDescription </td>
<td> [string] </td>
<td>Informational variable. Returns the project&#8217;s description, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoElapsedTimeMS </td>
<td> [number] </td>
<td>Informational variable. Returns the amount of time (in milliseconds) that has elapsed since the project began playing.</td>
</tr>
<tr>
<td> cpInfoEmail </td>
<td> [string] </td>
<td>Informational variable. Returns the project author&#8217;s e-mail address, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoEpochMS </td>
<td> [number] </td>
<td>Informational variable. Returns the current time elapsed (in milliseconds) since January 01, 1970.</td>
</tr>
<tr>
<td> cpInfoHasPlaybar </td>
<td> [number] </td>
<td>Informational variable. Indcates whether the Captivate movie has a playbar. 1=true, 0=false</td>
</tr>
<tr>
<td> cpInfoIsStandalone </td>
<td> [number] </td>
<td>Informational variable. Indicates whether Captivate project is en .exe or .app file (1) or standard SWF (0).</td>
</tr>
<tr>
<td> cpInfoLastVisitedSlide </td>
<td> [number] </td>
<td>Informational variable. Returns the last visited slide number. (Unlike cpInfoCurrentSlide, this variable uses 0-based index)</td>
</tr>
<tr>
<td> cpInfoPercentage </td>
<td> [number] </td>
<td>Informational variable. Returns the current score as a percentage (if available).</td>
</tr>
<tr>
<td> cpInfoPrevSlide </td>
<td> [number] </td>
<td>Informational variable. Returns the number of the slide before the current slide. (Uses 1-based index)</td>
</tr>
<tr>
<td> cpInfoProjectName </td>
<td> [string] </td>
<td>Informational variable. Returns the project&#8217;s name, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpInfoWebsite </td>
<td> [string] </td>
<td>Informational variable. Returns the project&#8217;s web addess, as entered in the movie&#8217;s properties before publishing.</td>
</tr>
<tr>
<td> cpLockTOC </td>
<td> [number] </td>
<td>Command variable. Setting to 1 disables user interaction on the Table of Contents. Setting to 0 re-enables (unlocks) user interaction.</td>
</tr>
<tr>
<td> cpMovieHeight </td>
<td> [number] </td>
<td>Informational variable. Returns the height of the Captivate project, in pixels.</td>
</tr>
<tr>
<td> cpMovieWidth </td>
<td> [number] </td>
<td>Informational variable. Returns the width of the Captivate project, in pixels.</td>
</tr>
<tr>
<td> cpMovieXForEmbededPlaybar </td>
<td> [number] </td>
<td>Informational variable. Returns the x coordinate (left position) of the Captivate project&#8217;s toolbar, if available.</td>
</tr>
<tr>
<td> cpMovieXForTOC </td>
<td> [number] </td>
<td>Informational variable. Returns the x coordinate (left position) of the Captivate project&#8217;s Table of Contents movieclip, if available.</td>
</tr>
<tr>
<td> cpMovieYForEmbededPlaybar </td>
<td> [number] </td>
<td>Informational variable. Returns the y coordinate (top position) of the Captivate project&#8217;s toolbar, if available.</td>
</tr>
<tr>
<td> cpMovieYForTOC </td>
<td> [number] </td>
<td>Informational variable. Returns the y coordinate (top position) of the Captivate project&#8217;s Table of Contents movieclip, if available.</td>
</tr>
<tr>
<td> cpOrgSWFPath</td>
<td> [string] </td>
<td>
<p>Informational variable. Provides the file name for the project&#8217;s main SWF. Appears to duplicate functionality of cpOrgSWFPath.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> cpQuizInfoAnswerChoice </td>
<td> [string] </td>
<td>Informational variable. Returns the chosen answer for the quiz question.</td>
</tr>
<tr>
<td> cpQuizInfoAttempts </td>
<td> [number] </td>
<td>Informational variable. Returns the number of times the quiz has been attempted.</td>
</tr>
<tr>
<td> cpQuizInfoLastSlidePointScored </td>
<td> [number] </td>
<td>Informational variable. Returns the score for the last visited quiz slide.</td>
</tr>
<tr>
<td> cpQuizInfoMaxAttemptsOnCurrentQuestion </td>
<td> [number] </td>
<td>Informational variable. Returns the number of attempts allowed for this quiz question.</td>
</tr>
<tr>
<td> cpQuizInfoNoQuestionsPerQuiz </td>
<td></td>
<td>Informational variable. No information available. Best guess: returns the number of questions in the quiz.</td>
</tr>
<tr>
<td> cpQuizInfoPassFail </td>
<td> [number] </td>
<td>Informational variable. Returns the result of the quiz: pass or fail.</td>
</tr>
<tr>
<td> cpQuizInfoPointsPerQuestionSlide </td>
<td> [number] </td>
<td>Informational variable. Returns the number of points for this quiz question.</td>
</tr>
<tr>
<td> cpQuizInfoPointsscored </td>
<td> [number] </td>
<td>Informational variable. Returns the total number of points scored in the project.</td>
</tr>
<tr>
<td> cpQuizInfoQuestionSlideTiming </td>
<td> [number] </td>
<td>Informational variable. Returns the time limit  for the current question (in seconds).</td>
</tr>
<tr>
<td> cpQuizInfoQuestionSlideType </td>
<td> [string] </td>
<td>Informational variable. Returns the current question&#8217;s type (multiple-choice, true-false, likert, etc.).</td>
</tr>
<tr>
<td> cpQuizInfoQuizPassPercent </td>
<td> [number] </td>
<td>Informational variable. Returns the passing percentage for the quiz.</td>
</tr>
<tr>
<td> cpQuizInfoQuizPassPoints </td>
<td> [number] </td>
<td>Informational variable. Returns the passing points for the quiz.</td>
</tr>
<tr>
<td> cpQuizInfoTotalCorrectAnswers </td>
<td> [number] </td>
<td>Informational variable. Returns the number of correctly answered quiz questions.</td>
</tr>
<tr>
<td> cpQuizInfoTotalProjectPoints </td>
<td> [number] </td>
<td>Informational variable. Returns the total number of points for the project.</td>
</tr>
<tr>
<td> cpQuizInfoTotalQuestionsPerProject </td>
<td> [number] </td>
<td>Informational variable. Returns the total number of questions for the project.</td>
</tr>
<tr>
<td> cpQuizInfoTotalQuizPoints </td>
<td> [number] </td>
<td>Informational variable. Returns the total number of quiz points for the project.</td>
</tr>
<tr>
<td> cpQuizInfoTotalUnansweredQuestions </td>
<td> [number] </td>
<td>Informational variable. Returns the total number of unanswered questions for the project.</td>
</tr>
<tr>
<td> endSwfAction </td>
<td> [number] </td>
<td>Internal variable. No information available.</td>
</tr>
<tr>
<td> expired </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Boolean indicating whether time limit has elapsed.</td>
</tr>
<tr>
<td> hasProjectFadeOut </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Boolean indicating whether last slide in project is set to fade out.</td>
</tr>
<tr>
<td> inAutoPlayState </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Boolean indicating whether project is set to auto-play.</td>
</tr>
<tr>
<td> isCPMovie </td>
<td> [boolean] </td>
<td>Informational variable. Indicates whether the SWF is a Captivate SWF.</td>
</tr>
<tr>
<td> isContiniousModeRecording </td>
<td> [number] </td>
<td>Internal variable. No information available. (Yes, that&#8217;s how it was spelled in the code.)</td>
</tr>
<tr>
<td> isCustomizable </td>
<td> [boolean] </td>
<td>
<p>Internal variable. No information available. Best guess: Indicates whether the skin is customizable.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> isForceMuteAudio </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the audio was muted by the user.</td>
</tr>
<tr>
<td> isPlayBarBtnClicked </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether a specific action was performed via clicking the playbar (such as muting audio).</td>
</tr>
<tr>
<td> isPreview </td>
<td> [number] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).</td>
</tr>
<tr>
<td> isPreviewForAudioDialog </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).</td>
</tr>
<tr>
<td> isPreviewSkin </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the project SWF&#8217;s skin is a preview SWF (used when previewing projects within the Captivate authoring environment).</td>
</tr>
<tr>
<td> lmsString </td>
<td> [string] </td>
<td>Internal variable. No information available. Best guess: The text displayed when Captivate initializes an LMS connection (SCORM, AICC, etc.).</td>
</tr>
<tr>
<td> loadedFromAggregator </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the Captivate SWF was loaded as part of an aggregator project.</td>
</tr>
<tr>
<td> m_quizPoolColl </td>
<td> [object] </td>
<td>Internal variable. No information available. Best guess: Object containing question pool questions.</td>
</tr>
<tr>
<td> movieQuality </td>
<td> [string] </td>
<td>Internal variable. No information available. Best guess: Indicates quality setting of SWF playback.</td>
</tr>
<tr>
<td>
<p>movieXML</p>
</td>
<td>
<p>[string] in Chrome</p>
<p>[XML] in Firefox </p>
</td>
<td>
<p>Internal variable, no information available.</p>
<p>NOTE: This item is<br />
    :XML data type in AS3. Because browsers have different support for native XML data types, values returned from this variable should not be considered cross-browser. Use at your own risk.</p>
</td>
</tr>
<tr>
<td> needToMuteAudioForAggregator</td>
<td> [boolean] </td>
<td>
<p>Internal variable. No information available.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> passwordPresent </td>
<td> [boolean] </td>
<td>Internal variable. Indicates whether a password has been supplied.</td>
</tr>
<tr>
<td> pbcBtnTips </td>
<td> [object] </td>
<td>Internal variable. Alias for pbcBtnTips_ENU.</td>
</tr>
<tr>
<td> pbcBtnTips_ENU </td>
<td> [object] </td>
<td>Internal variable (array). Returns list of tooltips used by the playbar buttons.</td>
</tr>
<tr>
<td> playbarBarAlign</td>
<td> [number] </td>
<td>
<p>Internal variable. No information available.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> playbarHeight </td>
<td> [number] </td>
<td>Informational variable. Returns height of playbar, in pixels.</td>
</tr>
<tr>
<td> playbarPosition </td>
<td> [number] </td>
<td>
<p>Internal variable. No information available.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> rdIsInLivePreviewMode </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the SWF is a preview SWF (used when previewing projects within the Captivate authoring environment).</td>
</tr>
<tr>
<td> rdIsPreview </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Deprecated variable replaced by isPreview</td>
</tr>
<tr>
<td> rdIsPreviewInBrowser </td>
<td> [boolean] </td>
<td>Internal variable. No information available.</td>
</tr>
<tr>
<td> rdIsStandalone </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Deprecated variable replaced by  cpInfoIsStandalone</td>
</tr>
<tr>
<td> rdcmndCC </td>
<td> [number] </td>
<td>Command variable (deprecated). Alias for cpCmndCC.</td>
</tr>
<tr>
<td> rdcmndExit </td>
<td> [number] </td>
<td>Command variable. According to Captivate documentation, &quot;Exit the movie. Set to 1 to exit.&quot; Has never worked for me.</td>
</tr>
<tr>
<td> rdcmndGotoFrame </td>
<td> [number] </td>
<td>Command variable (deprecated). Alias for cpCmndGotoFrame.</td>
</tr>
<tr>
<td> rdcmndGotoFrameAndResume </td>
<td> [number] </td>
<td>Command variable (deprecated). Alias for cpCmndGotoFrameAndResume.</td>
</tr>
<tr>
<td> rdcmndGotoSlide </td>
<td> [number] </td>
<td>Command variable (deprecated). Alias for cpCmndGotoSlide.</td>
</tr>
<tr>
<td> rdcmndMute </td>
<td> [boolean] </td>
<td>Command variable (deprecated). Alias for cpCmndMute.</td>
</tr>
<tr>
<td> rdcmndNext </td>
<td> [boolean] </td>
<td>Command variable (deprecated). Alias for cpCmndNext.</td>
</tr>
<tr>
<td> rdcmndNextSlide </td>
<td> [number] </td>
<td>Command variable (deprecated). Alias for cpCmndNext.</td>
</tr>
<tr>
<td> rdcmndPause </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will cause the movie to stop playing (pause). Setting to 0 will do nothing.</td>
</tr>
<tr>
<td> rdcmndPlaybarMoved </td>
<td> [boolean] </td>
<td>Command variable (deprecated). Alias for cpCmndPlaybarMoved.</td>
</tr>
<tr>
<td> rdcmndPrevious </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will cause the movie to stop playing (pause). Setting to 0 will do nothing.</td>
</tr>
<tr>
<td> rdcmndResume </td>
<td> [number] </td>
<td>Command variable. Setting to 1 will cause the movie to go backwards to the previous slide. Setting to 0 will do nothing.</td>
</tr>
<tr>
<td> rdinfoCurrentFrame </td>
<td> [number] </td>
<td>Informational variable. Returns current frame number using 0-based index.</td>
</tr>
<tr>
<td> rdinfoCurrentSlide </td>
<td> [number] </td>
<td>Informational variable (deprecated). Alias for cpInfoCurrentSlide.</td>
</tr>
<tr>
<td> rdinfoCurrentSlideInProject </td>
<td> [number] </td>
<td>Informational variable. No information available. Best guess: Alias for cpInfoCurrentSlide.</td>
</tr>
<tr>
<td> rdinfoFPS </td>
<td> [number] </td>
<td>Informational variable. Returns the SWF&#8217;s frame rate (in seconds).</td>
</tr>
<tr>
<td> rdinfoFrameCount </td>
<td> [number] </td>
<td>Informational variable. Returns the number of frames in the SWF.</td>
</tr>
<tr>
<td> rdinfoHasPlaybar </td>
<td> [boolean] </td>
<td>Informational variable (deprecated). Alias for cpInfoHasPlaybar.</td>
</tr>
<tr>
<td> rdinfoSlideCount </td>
<td> [number] </td>
<td>Informational variable. Returns the number of slides in the Captivate movie.</td>
</tr>
<tr>
<td> rdinfoSlidesInProject </td>
<td> [number] </td>
<td>Informational variable. No information available. Best guess: An unused/deprecated variable.</td>
</tr>
<tr>
<td> rdinfocurrFrame </td>
<td> [number] </td>
<td>Informational variable. No information available. Best guess: Alias for rdinfoCurrentFrame.</td>
</tr>
<tr>
<td> skinHeight</td>
<td> [number] </td>
<td>
<p>Internal variable. No information available.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> skinWidth </td>
<td> [number] </td>
<td>
<p>Internal variable. No information available.</p>
<p>NOTE: This value can only be obtained when the project uses an external skin.</p>
</td>
</tr>
<tr>
<td> swfCmtAutoPlay </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the SWF will auto-play when in commenting mode.</td>
</tr>
<tr>
<td> swfCommenting </td>
<td> [boolean] </td>
<td>Internal variable. No information available. Best guess: Indicates whether the SWF is in commenting mode.</td>
</tr>
<tr>
<td> tocInitDone </td>
<td> [boolean] </td>
<td>Internal variable. Indicates when the Table of Contents has finished initializing.</td>
</tr>
<tr>
<td> waitCount </td>
<td> [number] </td>
<td>Internal variable. Indicates how long the SWF has been waiting (used for internal timer-related functions).</td>
</tr>
</table>
<p><a href="http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/">Complete List of Variables for Adobe Captivate 5</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>


<p>Related posts:<ol><li><a href='http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/' rel='bookmark' title='Permanent Link: CaptivateController Updated to Support Adobe Captivate 5'>CaptivateController Updated to Support Adobe Captivate 5</a></li>
<li><a href='http://pipwerks.com/2009/05/16/captivate-4-variables-gone-wild/' rel='bookmark' title='Permanent Link: Captivate 4 variables gone wild'>Captivate 4 variables gone wild</a></li>
<li><a href='http://pipwerks.com/2008/09/08/control-a-captivate-swf-using-javascript-the-basics/' rel='bookmark' title='Permanent Link: Control a Captivate SWF using JavaScript: The basics'>Control a Captivate SWF using JavaScript: The basics</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/pipwerks/~4/rwXHU_GxEF0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/</feedburner:origLink></item>
		<item>
		<title>CaptivateController Updated to Support Adobe Captivate 5</title>
		<link>http://feedproxy.google.com/~r/pipwerks/~3/QcC4UJH0PSA/</link>
		<comments>http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 05:25:42 +0000</pubDate>
		<dc:creator>philip</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Captivate]]></category>
		<category><![CDATA[Adobe Captivate Hacks]]></category>
		<category><![CDATA[CaptivateController]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://pipwerks.com/?p=1253</guid>
		<description><![CDATA[By popular demand, I've updated my CaptivateController to work with Adobe Captivate 5 (CP5). Since this is an open-source project, there's no upgrade fee. (What? "Adobe" and "no upgrade fee" in the same paragraph?!) I kid, I kid... I'm a kidder.<p><a href="http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/">CaptivateController Updated to Support Adobe Captivate 5</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>By popular demand, I&#8217;ve updated my CaptivateController to work with Adobe Captivate 5 (CP5). Since this is an open-source project, there&#8217;s no upgrade fee. (What? &#8220;Adobe&#8221; and &#8220;no upgrade fee&#8221; in the same paragraph?!) I kid, I kid&#8230; I&#8217;m a kidder.</p>
<p>As you may have heard, Adobe Captivate 5 is a complete re-write of the Adobe Captivate application. As such, there are a few significant changes under-the-hood. For example, Adobe Captivate 5 does not support ActionScript 2, and will only publish to ActionScript 3. The Captivate developers eliminated a few of the old system variables while <a href="http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/">adding a few new ones</a>. Showing and hiding the playbar now works very reliably (yay!). Most notably, the developers added extra ExternalInterface support via the <code>cpEIGetValue</code> and <code>cpEISetValue</code> callback functions while eliminating the <code>cpSetValue</code> callback, which explains why the previous version of the CaptivateController didn&#8217;t work with CP5 SWFs.</p>
<p>As for the updated CaptivateController, it works the same as the previous version. Most of the changes were under-the-hood, so you shouldn&#8217;t need to edit any of your code, and should be able to drop this new version on top of your old one.  <a href="http://twitter.com/pipwerks/status/21929007403">No system restart required</a>!</p>
<ul>
<li><a href="http://pipwerks.com/d/15">Download the updated CaptivateController</a></li>
<li><a href="http://pipwerks.com/2009/06/07/introducing-the-captivatecontroller/">CaptivateController documentation</a></li>
<li><a href="http://pipwerks.com/lab/captivate/CaptivateController/testsuite/queries-automated.html">View the test suite</a></li>
<li><a href="http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/">Complete list of variables for Adobe Captivate 5</a></li>
</ul>
<p>If you encounter any bugs, please let me know by posting in the comments. I&#8217;d also be happy to hear any success stories you may have.</p>
<p><a href="http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/">CaptivateController Updated to Support Adobe Captivate 5</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>


<p>Related posts:<ol><li><a href='http://pipwerks.com/2010/08/23/complete-list-of-variables-for-adobe-captivate-5/' rel='bookmark' title='Permanent Link: Complete List of Variables for Adobe Captivate 5'>Complete List of Variables for Adobe Captivate 5</a></li>
<li><a href='http://pipwerks.com/2009/09/26/captivatecontroller-updated/' rel='bookmark' title='Permanent Link: CaptivateController updated'>CaptivateController updated</a></li>
<li><a href='http://pipwerks.com/2009/06/07/introducing-the-captivatecontroller/' rel='bookmark' title='Permanent Link: Introducing the CaptivateController'>Introducing the CaptivateController</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/pipwerks/~4/QcC4UJH0PSA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/</feedburner:origLink></item>
		<item>
		<title>Adobe Captivate: What the heck is g_intAPIType?</title>
		<link>http://feedproxy.google.com/~r/pipwerks/~3/tSGGKNET2Jw/</link>
		<comments>http://pipwerks.com/2010/08/18/adobe-captivate-what-the-heck-is-g_intapitype/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 14:00:38 +0000</pubDate>
		<dc:creator>philip</dc:creator>
				<category><![CDATA[SCORM]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[Adobe Captivate]]></category>
		<category><![CDATA[Adobe Captivate Hacks]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://pipwerks.com/?p=1242</guid>
		<description><![CDATA[If you do spend any time using Captivate to create SCORM-conformant courses, you're bound to have run into an issue or two that caused you to read some Captivate forum posts. Almost without fail, someone will mention that the solution to their problem was changing the value of the magical <code>g_intAPIType</code> JavaScript variable from 1 to 0 or from 0 to 1.

So what the heck is <code>g_intAPIType</code>, and why does changing it make a difference?<p><a href="http://pipwerks.com/2010/08/18/adobe-captivate-what-the-heck-is-g_intapitype/">Adobe Captivate: What the heck is g_intAPIType?</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>If you spend any time using Adobe Captivate to create SCORM-conformant courses, you&#8217;re bound to have run into an issue or two that caused you to read some Captivate forum posts. Almost without fail, someone will mention that the solution to their problem was changing the value of the magical <code>g_intAPIType</code> JavaScript variable from 1 to 0 or from 0 to 1.</p>
<p>So what the heck is <code>g_intAPIType</code>, and why does changing it make a difference?</p>
<p>The short version is this:  Captivate courses, when published for SCORM, typically use one of two communication methods: FSCommand or <code>getURL</code>. FSCommand works really well in some browsers, such as Internet Explorer, but has spotty support in others. <code>getURL</code> works in all browsers, but uses a more complicated communication system when sending data to your Captivate file from the LMS. It also makes a lot of clicking sounds. </p>
<p>Setting <code>g_intAPIType</code> to 0 means you&#8217;re forcing Captivate to use FSCommand in all browsers. Setting <code>g_intAPIType</code> to 1 means you&#8217;re forcing Captivate to use <code>getURL</code> in all browsers.  If you don&#8217;t manually specify the value of <code>g_intAPIType</code>, Captivate&#8217;s SCORM template includes some browser sniffing that automatically sets <code>g_intAPIType</code> to 0 for Internet Explorer and 1 for all other browsers.</p>
<p>Want to know more about FSCommand versus <code>getURL</code>? Colin Moock wrote <a href="http://www.moock.org/webdesign/flash/fscommand/">a good FSCommand tutorial that covers the basics</a>. </p>
<p>Note: <a href="http://www.adobe.ge/devnet/flash/articles/external_interface.html">ExternalInterface</a> has replaced both of these methods as the favored Flash-to-JavaScript communication method, but Captivate has not caught up yet.</p>
<p><a href="http://pipwerks.com/2010/08/18/adobe-captivate-what-the-heck-is-g_intapitype/">Adobe Captivate: What the heck is g_intAPIType?</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>


<p>Related posts:<ol><li><a href='http://pipwerks.com/2010/08/23/captivatecontroller-updated-to-support-adobe-captivate-5/' rel='bookmark' title='Permanent Link: CaptivateController Updated to Support Adobe Captivate 5'>CaptivateController Updated to Support Adobe Captivate 5</a></li>
<li><a href='http://pipwerks.com/2010/05/19/customizing-scorm-manifests-in-captivate-and-articulate-presenter/' rel='bookmark' title='Permanent Link: Customizing SCORM Manifests in Captivate and Articulate Presenter'>Customizing SCORM Manifests in Captivate and Articulate Presenter</a></li>
<li><a href='http://pipwerks.com/2007/08/10/actionscript-javascript-and-scorm/' rel='bookmark' title='Permanent Link: Actionscript, JavaScript, and SCORM'>Actionscript, JavaScript, and SCORM</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/pipwerks/~4/tSGGKNET2Jw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pipwerks.com/2010/08/18/adobe-captivate-what-the-heck-is-g_intapitype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://pipwerks.com/2010/08/18/adobe-captivate-what-the-heck-is-g_intapitype/</feedburner:origLink></item>
		<item>
		<title>SCORM Tip: Use an onunload handler</title>
		<link>http://feedproxy.google.com/~r/pipwerks/~3/M7wj7W8cfAs/</link>
		<comments>http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 14:00:54 +0000</pubDate>
		<dc:creator>philip</dc:creator>
				<category><![CDATA[SCORM]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SCORM actionscript class]]></category>
		<category><![CDATA[SCORM wrapper]]></category>

		<guid isPermaLink="false">http://pipwerks.com/?p=1231</guid>
		<description><![CDATA[What happens if the browser window containing your course is closed by the learner before the course finishes sending data to the LMS? If you're not careful about how you've coded your course, you can lose some of the data.<p><a href="http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/">SCORM Tip: Use an onunload handler</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>SCORM courses use JavaScript to send data to the LMS. This data then sits in the browser until the LMS writes it to the database (usually via AJAX or form posts). As <a href="http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/">previously discussed</a>, invoking <code>commit</code> (save) will ensure the LMS actually writes this data to a database.</p>
<p>But what happens if the browser window containing your course is closed by the learner before the course finishes sending data to the LMS? If you&#8217;re not careful about how you&#8217;ve coded your course, you can lose some of the data. For example, if a learner completes the course and then immediately closes the window, the course might not have had enough time to tell the LMS about the completion, preventing the completion from appearing in the learner&#8217;s record.</p>
<p>It&#8217;s best to be proactive about this by setting up an event handler for the browser&#8217;s <code><a href="https://developer.mozilla.org/en/DOM/window.onunload">unload</a></code> and <code><a href="https://developer.mozilla.org/en/DOM/window.onbeforeunload">onbeforeunload</a></code> events. Whatever code you place in these events will execute when the browser is closed. In a SCORM course, you should place a <code>commit</code> (save) and <code>terminate</code> (quit) command in these events to ensure the SCORM data is properly persisted in the database and the session is properly terminated.</p>
<p>The code is pretty straightforward (this example uses SCORM 2004):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #AAA;">//Assuming API refers to your SCORM API</span>
<span style="color: #AAA;">//and API_isActive returns a boolean indicating</span>
<span style="color: #AAA;">//whether your API has already been terminated</span>
&nbsp;
<span style="color: #33F;">var</span> unloaded <span style="color: #333;">=</span> <span style="color: #33F;">false</span><span style="color: #333;">;</span>
<span style="color: #33F;">function</span> unloadHandler<span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #666;">&#123;</span>
   <span style="color: #33F;">if</span><span style="color: #666;">&#40;</span><span style="color: #333;">!</span>unloaded <span style="color: #333;">&amp;&amp;</span> API_isActive<span style="color: #666;">&#41;</span><span style="color: #666;">&#123;</span>
      API.<span style="color: #63C;">SetValue</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.exit&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;suspend&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span> <span style="color: #AAA;">//Set exit to whatever is needed</span>
      API.<span style="color: #63C;">Commit</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span> <span style="color: #AAA;">//save all data that has already been sent</span>
      API.<span style="color: #63C;">Terminate</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span> <span style="color: #AAA;">//close the SCORM API connection properly</span>
      unloaded <span style="color: #333;">=</span> <span style="color: #33F;">true</span><span style="color: #333;">;</span>
   <span style="color: #666;">&#125;</span>
<span style="color: #666;">&#125;</span>
window.<span style="color: #63C;">onbeforeunload</span> <span style="color: #333;">=</span> unloadHandler<span style="color: #333;">;</span>
window.<span style="color: #33F;">onunload</span> <span style="color: #333;">=</span> unloadHandler<span style="color: #333;">;</span></pre></div></div>

<p>Since some browsers support <code>onbeforeunload</code> and others don&#8217;t, we use the <code>unloadHandler</code> on <em>both</em> <code>onbeforeunload</code> and <code>onunload</code>, just to be safe. If a browser supports both of these events, the <code>unloaded</code> boolean ensures the <code>scorm.quit</code> function is not executed more than once.</p>
<p>If you&#8217;re using the <a href="http://pipwerks.com/laboratory/scorm/api-wrapper-javascript/">pipwerks SCORM wrapper</a>, your code will be even simpler, because the pipwerks wrapper automatically checks the API&#8217;s availability before performing any action. The wrapper also sets the <code>cmi.exit</code>/<code>cmi.core.exit</code> parameter for you.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #33F;">var</span> unloaded <span style="color: #333;">=</span> <span style="color: #33F;">false</span><span style="color: #333;">;</span>
<span style="color: #33F;">function</span> unloadHandler<span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #666;">&#123;</span>
   <span style="color: #33F;">if</span><span style="color: #666;">&#40;</span><span style="color: #333;">!</span>unloaded<span style="color: #666;">&#41;</span><span style="color: #666;">&#123;</span>
      scorm.<span style="color: #63C;">save</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span> <span style="color: #AAA;">//save all data that has already been sent</span>
      scorm.<span style="color: #63C;">quit</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span> <span style="color: #AAA;">//close the SCORM API connection properly</span>
      unloaded <span style="color: #333;">=</span> <span style="color: #33F;">true</span><span style="color: #333;">;</span>
   <span style="color: #666;">&#125;</span>
<span style="color: #666;">&#125;</span>
window.<span style="color: #63C;">onbeforeunload</span> <span style="color: #333;">=</span> unloadHandler<span style="color: #333;">;</span>
window.<span style="color: #33F;">onunload</span> <span style="color: #333;">=</span> unloadHandler<span style="color: #333;">;</span></pre></div></div>

<p><a href="http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/">SCORM Tip: Use an onunload handler</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>


<p>Related posts:<ol><li><a href='http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/' rel='bookmark' title='Permanent Link: SCORM Tip: Don&#8217;t forget to commit!'>SCORM Tip: Don&#8217;t forget to commit!</a></li>
<li><a href='http://pipwerks.com/2008/05/18/scorm-api-wrapper-116/' rel='bookmark' title='Permanent Link: SCORM API Wrapper updated to auto-handle exit and status'>SCORM API Wrapper updated to auto-handle exit and status</a></li>
<li><a href='http://pipwerks.com/2008/05/08/adding-scorm-code-to-an-html-file/' rel='bookmark' title='Permanent Link: Adding SCORM code to an HTML file using the pipwerks SCORM wrapper'>Adding SCORM code to an HTML file using the pipwerks SCORM wrapper</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/pipwerks/~4/M7wj7W8cfAs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/</feedburner:origLink></item>
		<item>
		<title>SCORM Tip: Don’t forget to commit!</title>
		<link>http://feedproxy.google.com/~r/pipwerks/~3/R9g5H3CapnM/</link>
		<comments>http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 15:00:11 +0000</pubDate>
		<dc:creator>philip</dc:creator>
				<category><![CDATA[SCORM]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SCORM actionscript class]]></category>
		<category><![CDATA[SCORM wrapper]]></category>

		<guid isPermaLink="false">http://pipwerks.com/?p=1215</guid>
		<description><![CDATA[A number of people have recently asked me about the <code>scorm.save()</code> function in the pipwerks SCORM wrappers. What is it, and when should it be used?<p><a href="http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/">SCORM Tip: Don&#8217;t forget to commit!</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>A number of people have recently asked me about the <code>scorm.save()</code> function in the pipwerks SCORM wrappers. What is it, and when should it be used?</p>
<p>The pipwerks <code>scorm.save()</code> function is a shortcut for SCORM&#8217;s <code>Commit</code> (SCORM 2004) and <code>LMSCommit</code> (SCORM 1.2) methods. Invoking <code>commit</code> in SCORM means you are explicitly instructing the LMS to persist the data you&#8217;ve sent. In other words, you&#8217;re telling the LMS to save your stuff!</p>
<p>When sending data from your course to the LMS, the data is travelling from the course window to the LMS via JavaScript and is stored <em>in the browser</em>. The SCORM spec gives LMSs the flexibility to decide when to transfer this data to the database. Some LMSs will <strong>not</strong> immediately write the data to the database because it can clog up the system; they prefer to queue up the data and send it in bunches. This explains why some courses will be successful in sending the data from the course to the LMS, but the LMS doesn&#8217;t seem to save the data. <em>You didn&#8217;t tell it to!</em> I know, I know, it seems daft, but it happens. So, to be safe, ensure your data gets saved by instructing the LMS to save the data. </p>
<p>Note that some LMSs will automatically commit at the end of a session, usually by detecting if the course window was closed (<code>window.onunload</code>) or if a certain CMI call was invoked, such as setting the completion status. However, you should never take your chances, and should design your SCO to commit regularly. Just be careful not to overdo it. </p>
<p>The rule of thumb is to invoke a <code>commit</code> (<code>save()</code> if you use the pipwerks wrapper) after a significant chunk of data has been sent to the LMS, but <strong>not</strong> after each and every call:</p>
<p>NO (committing too frequently):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript">scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.location&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;some string indicating location&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">save</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.suspend_data&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;your custom suspend_data string&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">save</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.score.raw&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">80</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">save</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span></pre></div></div>

<p>NO (not committing enough):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript">scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.location&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;some string indicating location&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.suspend_data&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;your custom suspend_data string&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.score.raw&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">80</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span></pre></div></div>

<p>YES (one commit after a short series of &#8217;set&#8217; calls):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript">scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.location&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;some string indicating location&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.suspend_data&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">&quot;your custom suspend_data string&quot;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">set</span><span style="color: #666;">&#40;</span><span style="color: #F06;">&quot;cmi.score.raw&quot;</span><span style="color: #333;">,</span> <span style="color: #F06;">80</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span>
scorm.<span style="color: #63C;">save</span><span style="color: #666;">&#40;</span><span style="color: #666;">&#41;</span><span style="color: #333;">;</span></pre></div></div>

<p><a href="http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/">SCORM Tip: Don&#8217;t forget to commit!</a> is a post from: <a href="http://pipwerks.com">pipwerks.com</a>. Unless specified otherwise, all code is licensed under an <a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT-style</a> license. All other content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>.</p>


<p>Related posts:<ol><li><a href='http://pipwerks.com/2010/08/06/scorm-tip-use-an-onunload-handler/' rel='bookmark' title='Permanent Link: SCORM Tip: Use an onunload handler'>SCORM Tip: Use an onunload handler</a></li>
<li><a href='http://pipwerks.com/2008/04/27/how-to-add-basic-scorm-code-to-a-flash-movie/' rel='bookmark' title='Permanent Link: How to add basic SCORM code to a Flash movie'>How to add basic SCORM code to a Flash movie</a></li>
<li><a href='http://pipwerks.com/2008/02/11/really-simple-scorm-as3-wrapper-example/' rel='bookmark' title='Permanent Link: Really simple SCORM AS3 wrapper example'>Really simple SCORM AS3 wrapper example</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/pipwerks/~4/R9g5H3CapnM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://pipwerks.com/2010/07/27/scorm-tip-dont-forget-to-commit/</feedburner:origLink></item>
	</channel>
</rss>
