FS SCORM Publishing Template for Flash 5

The purpose of the FS SCORM template is to make it easy for developers to create and publish Flash movies that communicate to a Learning Management System (LMS) using the ADL SCORM Runtime Interface (RTI) API. This API describes a standard way for learning content to get and set values relating to the active lesson and student.

The template includes JavaScript to find an ADL API object, and the requisite fscommand 'glue' to allow LMS functions to be called from a Flash movie. To make calls from a Flash movie, use a LMS function as the fscommand name, and quoted string for all arguments. Note that the LMS function names are case sensitive.

Example Calls

Command: LMSInitialize
Argument: ""
ActionScript Example: FSCommand("LMSInitialize,\"\"");
Return: None (error posted in JavaScript alert)

Command: LMSSetValue
Argument: "cmi.data.element,value"
ActionScript Example: FSCommand("LMSSetValue","cmi.core.lesson_status,completed");
Return: None (error posted in JavaScript alert)

Command: LMSGetValue
Argument: "cmi.data.element,myVariable"
ActionScript Example: FSCommand("LMSGetValue","cmi.core.student_name,name");
Return: Result put into Flash 'myVariable' store, Example places student name into Flash variable name.
(Use LMS functions to check for any 'Get' errors)

Command: LMSFinish
Argument:
""
ActionScript Example: FSCommand("LMSFinish,\"\"");
Return: None (error posted in JavaScript alert)

To fully utilize this template, one must have access to a learning management system that supports ADL SCORM style communication to an LMS. It is incumbent upon your LMS vendor to provide a suitable API adapter object for you to embed, or to automatically provide such an object in the opener window or a frameset at run-time.

The HTML and JavaScript included in this template will find the API object (also called the LMS host adapter) as provided by your Learning Management System (LMS). Unlike the Flash SCORM templates, the FS SCORM template does not automatically call the LMSInitialize and LMSFinish methods of the API object. For content to fully comply with the ADL SCORM runtime interface requirements, the developer must make sure that LMSInitialize is called once at the beginning and LMSFinish is called at the end of the content session either through fscommands with the movie or by other means.

For more information on the ADL and SCORM see: http://www.ADLnet.org

FS SCORM Template Details

To use the FS SCORM publishing template, use File > Publish Settings... to access the Publish Settings Dialog. Select the HTML tab and choose the Template "FS SCORM", as indicated in the figure below.

In addition to using the template when your movie is published, your movie itself will need to include callbacks to API methods using fscommands. The SCORM specification requires run time compliant content to:

The FS SCORM template includes JavaScript code and HTML attributes to:

Developers must make sure that LMSInitialize is called only once, even if the movie branches back to the opening frame. Typically developers will use ActionScript in the first frame to call LMSInitialize and set a variable. The code that calls LMSInitialize checks the variable to make sure it is not called twice.

Elsewhere in the movie, user actions may trigger fscommands that make LMSSetValue calls to update lesson status or student performance data, such as the score or last location (for internal bookmarking). Likewise, fscommands may make LMSGetValue calls to get values from the LMS and pass them back into named variables in the Flash movie.

Finally, the developer must assure that the movie calls LMSFinish only once, at the logical end or exit point of the movie. Note that LMSFinish must be the last API method that is called, and no other API methods should be called after it. See the ADL web site for more information and the most recent version of the SCORM specification. The FS SCORM sample movie named SCORM.fla, demonstrates how Flash movies can use fscommands to call back to API methods. The section below explains more about the sample movie.

FS SCORM Sample File

The FS SCORM extension will copy the Flash sample file SCORM.fla to the "Flash 5/Samples" folder. If you have less than 24 sample files in that folder, the sample will also be available from the Flash menu, Help>Sample>SCORM.

In the sample file, the Actions for frame 1 show how API.LMSInitialize and API.LMSSetValue are called from ActionScript using fscommands. See below for an example as shown in the Movie Explorer.
actions for frame 1
Note that the variable "lmsInitialized" is used to prevent the API.LMSInitialize method from being called a second time if the movie returns back to frame 1.

The ActionScript code from frame 30 shows how the API.LMSGetValue can be called to set a Flash variable.
actions for frame 30
In this case the variable full_name is initialized to "Test,Name", but will be immediately set to the value returned by the API adapter when LMSGetValue is called in the next line. Note that the name of the variable (full_name) is a second argument to the fscommand in addition to the data element (cmi.core.student_name). Because fscommands take only one argument, only a single pair of quotes is used, around both the data element name and the variable name, and a comma is placed between them.

Finally, the Stop action show how API.LMSFinish is invoked to close the LMS session.
actions for stop

Examine the other clips and actions in the movie for more examples of how to send data back to an LMS, including some sample code for calculating and formatting the time. You can develop your own ActionScript for buttons or other user events to determine lesson completion, scores, or even to store a bookmark location within the movie.

Check for the latest learning extension information at:
http://exchange.macromedia.com or http://www.macromedia.com/learning