Basic Flash SCORM Code #edtech

Develop bespoke Flash interactions that report to SCORM compatible LMSs

I’ve been using the following code in Actionscript 1 Flash activities for quite a few years now.  It works with the default SCORM html template available in html publish options.  Just having had a quick look at Actionscript 3 changes, it looks like it should still work fine in AS 3 projects.

NB:  When publishing the swf you need to name the file without any spaces, eg DragAndDrop1.swf.  This is so that the naming of the function in javascript doesn’t get broken.

Starting code

_root.start_time = Math.round(getTimer()/1000);
fscommand(“CMIInitialize”, “”);
fscommand(“MM_cmiSetLessonStatus”, “i”);   // set LMS to incomplete
fscommand(“MM_StartSession”, “”);

Code to put in function called when activity is completed

fscommand(“MM_cmiSetLessonStatus”, “completed”);
fscommand(“CMISetTime”, Math.round(getTimer()/1000)-_root.startTime);
fscommand(“CMISetScore”, Math.round(Your custom score function here(eg:(tries/score)*100);
fscommand(“CMIFinish”, “”);
fscommand(“CMIExitAU”, “”);

This entry was posted in Flash and eLearning. Bookmark the permalink.

One Response to Basic Flash SCORM Code #edtech

  1. Pingback: Basic Flash SCORM Code | Anything and everythin...