If I understand you correctly, you just need to get the value of one of the SCORM CMI elements from the LMS, then import it into your SWF.
Since you're wrapping it all in a Captivate course, we can take advantage of Captivate's SCORM wrapper. Here's one way to do it:
Getting data from LMS.
I suggest doing this via JavaScript. Captivate's SCORM wrapper uses the name "g_objAPI" to refer to the SCORM API. To get the data from SCORM, just use the standard SCORM API with g_objAPI:
g_objAPI.LMSGetValue("cmi.core.student_name"); //returns a string
Use ExternalInterface to send the data from JS to AS
Create a JavaScript function that can be invoked via ExternalInterface in your custom SWF:
function getStudentName(){
return g_objAPI.LMSGetValue("cmi.core.student_name");
}
Then use ExternalInterface in your custom SWF to grab the data:
var student_name:String = ExternalInterface.call("getStudentName");
------
Note: If you want to adapt this code to be able to get other SCORM data, just refactor the JS function and ExternalInterface call:
//In your JS
function getScormData(CMI_element){
return g_objAPI.LMSGetValue(CMI_element);
}
//In your AS
var student_name:String = ExternalInterface.call("getScormData", "cmi.core.student_name");
var student_id:String = ExternalInterface.call("getScormData", "cmi.core.student_id");
//etc.
- philip