SCORM flash file contained inside SCORM html page

347 views
Skip to first unread message

Wayne P

unread,
Mar 11, 2011, 5:54:31 AM3/11/11
to eLearning Technology and Development
Dear all,

I've been working on a course where the html files open connection to
the LMS and send any relevent data back and forth, this has been
working fine along with flash files without scorm code. But now that
I'm trying to add scorm code to the flash files, connection fails
within the flash files.

After flash returns it's fail the connection is working fine for the
html/js functions but the flash is refusing to work with the lms
properly.

If I try to call scorm.connect(); I end up with this error:
pipwerks.SCORM.init() failed. Error code: 101
Error info: General exception
Error Diagnostic: LMSInitialize has already been called.
__connectionActive: false
pipwerks.SCORM.save() failed: API connection is inactive.


And if I trying to set a value and disconnect after the above, i get:
pipwerks.SCORM.set(cmi.objectives.0.score.raw) failed: connection is
inactive.
pipwerks.SCORM.quit aborted: connection already inactive.

If I don't use the scorm.connect call I still get 'connection is
inactive', when trying to modify data on the lms.

By receiving an error code, it means it has found the API and LMS but
is doing something wrong.

I realise by calling the connect() inside the flash file I'm calling
the lms connect for a second time.. not how it should be.

I'm using SCORM 1.2, and the pipwerks as3 and js wrappers.


Any help would be greatly appreciated.
Wayne

Philip Hutchison

unread,
Mar 11, 2011, 2:01:51 PM3/11/11
to elearning-technolo...@googlegroups.com
Hi Wayne

If I understand you correctly, you have an HTML-based course that also includes a little Flash in some places. You want these Flash bits to use SCORM.

The wrappers were designed to be either all HTML/JavaScript or all ActionScript, not both.  This is why you're getting an error. The ActionScript wrapper can't initialize a SCORM session if the JavaScript wrapper has already done it.

Since you're already using JavaScript in the HTML portion of your course, the easiest solution is to remove the ActionScript wrapper. Instead, use ExternalInterface in your AS code to invoke functions in the JavaScript wrapper whenever you need them.

-----

import flash.External.*;

//Setting something
ExternalInterface.call("pipwerks.SCORM.set", "cmi.score.raw", 85);
ExternalInterface.call("pipwerks.SCORM.save");

//Getting something
var learner_name:String = ExternalInterface.call("pipwerks.SCORM.get", "cmi.learner_name");

-----

Be sure to import the ExternalInterface class into your SWF; it only needs to be done once per SWF.

Using this approach, you can let your HTML/JavaScript remain in control, and simply pass your requests from the ActionScript to the JavaScript. Just call the few items you need.

Since the HTML/JavaScript side has already initialized the SCORM connection, you don't need to initialize again.

- philip





--
You received this message because you are subscribed to the Google Groups "eLearning Technology and Development" group.
To post to this group, send email to elearning-technolo...@googlegroups.com.
To unsubscribe from this group, send email to elearning-technology-and...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/elearning-technology-and-development?hl=en.


Reply all
Reply to author
Forward
0 new messages