SCORM 1.2 and ExternalInterface">SCORM 1.2 and ExternalInterface
SCORM 1.2 ExternalInterface Demonstration
Whew, it’s been a long time since I actually touched code, but after three months of writing up nothing but process and standards documents, an email (and guestbook entry) really got me motivated to do something I’ve talked for a while now.
What I’ve assembled here is a full-on SCORM 1.2-conformant content package of how Flash 8 can use ExternalInterface to work with the good ol’ ADL APIWrapper.js to get information in and out of Flash. I even incorporated bookmarking to give you an idea of just how easy it is.
After toiling away on the job stuck in Flash 7 last year, and clunking around the noble (but limiting) Flash-JavaScript Integration Kit from osFlash, it was fun to tinker around in just a little bit of time and get the underpinnings down for talking to an LMS all out of Flash.
It even runs in Saba :O.
Anyway, the content package is here. It includes the .fla. Feel free to comment away or ask questions.



Hi there Aaron,
I’ve been asked to implement ‘SCORM compliant’ Flash recently, so in my search for answers (e-Learning is relatively fresh to me) I have found your site and thus, your demo.
Upon downloading, unzipping and opening ‘scormExternalInterfaceDemo.html’ I receive the error:
“LMS Communication Initialized: null
“
Initialized Failed
The unhappy face sums it up nicely! I was stoked to find demo code that’s really easy to read, but am I missing something? Do I need a web server or an LMS running? Or perhaps a better question would be what setup do I need to have this demo run locally? Also, the ‘.xsd’ files have an unknown file icon – are these editable files? DO I need a program to edit them?
So many questions, hoping not to put you off answering them
thanks for any help in advance,
Dave
Dave,
First off, everybody in this business is still new, so your questions are not only valid, they highlight how confusing it can be to get into this game.
Now, to your questions…
The error you received is a result of you running the content outside of a SCORM Run-Time Environment. Any LMS that uses SCORM 1.2 is a Run-Time Environment. You can also download the Sample Run-Time Environment from http://www.adlnet.gov. You need the Java VRE to run it (I think it’s now been tested up to Java 1.4.2_02), but it will work without that “Failure to Initialize” error if you’re running it in the RTE. The Sample RTE is designed to run locally.
The reason why you’re getting it outside of the RTE is because there’s no RTE to initialize communication with.
Now, the .xsd files you see in the content package (the .zip file, or PIF as it’s referred to in the documentation) are schema files that help validate the content package’s manifest information, located in the imsmanifest.xml file. You should open that up and see what it looks like. You’ll find two sections of note — an Organizations section that describes the order in which content will appear in a SCORM RTE, and a Resources section, which defines what is a Sharable Content Object. It’s the resources that are referenced in the Organizations section, by their ID numbers.
This information is all spelled out in technical detail in the SCORM 1.2 documentation (also on adlnet.gov).
If there’s interest, I’ll try and throw a more substantial tutorial together on the subject, although if you’re willing to jump to SCORM 2004, there are content examples already available for download that will play in the SCORM 2004 Sample RTE that talk in detail (and are written for content developers) that teach to the highly technical information documented in SCORM 2004.
The content examples can be downloaded from adlnet.gov, and they are all coded so you can break them open and read the comments to follow along (I don’t mind saying I helped put those together, as well).
Thank you so much Aaron!
I’ve tested it and saw it working on Moodle. However, I have been unable to test the course under the ADL SCORM 1.2 Test suite, and under the L5 SCORM producer preview for Dreamweaver as the initialization fails.
I am wondering if there is some kind of synchronization problem? Perhaps using some kind of event handler system? What are your thoughts on this?
Thx,
David
Hi David,
This content is probably not going to work locally unless you set your Security settings in the Flash 8 (or 9) player to accept local variable exchanges. And even then, some of the javascript won’t execute properly running locally, which is what the Test Suite does.
Though what I suggest would fly counter to a strict adherence of the use of the test suite, you might consider setting up IIS to run locally on your windows box and run the test suite via http. I’ve done that before — running the Test Suite via XAMPP and that allowed me to test content on my own computer before uploading it to the LMS.
I’m not a SCORM certification officer, so I can’t even tell you how they do it, but I’d guess it’d have to be something similar.
As for the integration in L5 SCORM producer, I don’t think that’s going to help much if you’re authoring any kind of Flash content. Not being as familiar with the tool as others are, if memory serves it auto-magically puts the code into your existing HTML content and then parses through your directory structure to build a manifest.
You can use Reload Editor to build content packages and the manifest, and it will work with everything. But if you’re building custom Flash content to run in an LMS — well, you’re bootstrapping it since there aren’t any plugins (that I know of) that do it all for you in Flash (Adobe/Macromedia made a noble attempt in Studio 8 and their templates “work” but I don’t like them much). I haven’t seen what CS3 will do for you yet, but since E-Learning isn’t a huge marketing segment for Adobe, I wouldn’t hold my breath that they’ve completely re-designed their SCORM support model.
There are a number of tools that will do it all for you — Articulate Presenter, Camtasia, Captivate — if the complexity of writing event handlers for all the interaction you want in Flash is too heavy for your timetables, you can always go the route of a more user-friendly authoring tool.
Long and short of it — working with Flash as an authoring medium isn’t brain surgery, but it isn’t as straightforward as anyone wants it to be.
Im building a flash thingy (technical i know im new to this too)
basicaly a user enters runs through a flash slide presntation and then the exit say on screen 10 when they come back i want the file to open on screen ten i was stoke to find your file and add this code to the exit button
_root.getURL(“javascript: window.close();”);
_root.getURL(“javascript: window.top.close();”);
so that it would close in the scorm tester i use (reload scorm 1.2 player)
but when i clcik the exit button using my flash file (wit extra code) or yours without it comes back with “Not Initialized” dialog box??
any thoughts on whats going on please?
so i got some long nights ) do you have direct urls to the ADSL site where this stuff is?
i wuld love to be able to run your file and see it open at the point of exit and display the infor in my scorm player (oh p.s. the deadline is 8th of the may
Rudolf,
You definitely don’t want to use _root.getURL() commands to access javascript if you can use Flash 8. Well maybe not “definitely,” but the whole idea behind this content example is how you can use ExternalInterface to send JavaScript commands, which should be less prone to unwanted results (// errors).
Testing in Reload Editor gives you a feel for how the content will play. Testing in the ADL Sample Run-Time Environment would be better.
The content example I have here is for SCORM 1.2, not SCORM 2004. You can switch them out (just switch out the APIWrapper.js for starters). But the code being used in the ActionScript is based on SCORM 1.2, so those Javascript calls in AS would need to be modified for SCORM 2004.
Also, since this is Flash running Javascript, chances are that it won’t run locally, so if you’re not in a server environment (even a server environment off your local drive), chances are good that it’s not going to initialize.
Unfortunately, the ADL website is in transition at the moment, so you’re going to have to hunt (via Google or Yahoo or the like) for someone else who might have the Sample RTE available. I couldn’t find it at first glance but I’m sure somebody’s got it available since your deadline is like… today.
You are my hero!
I have been looking for an example of SCORM 1.2 using the External Interface stuff. I had managed to figure out Flash and SCORM using FS Commands and the old publishing template, but that limited me to Flash 7 player and I want to take advantage of a lot of the run-time things that have come out (better text, bit-map caching, 9-slice, etc.) in the newer players. Your example saved me because I don’t know enough coding to figure all of that stuff out on my own, but with your example, I am able to manipulate it to get my stuff SCORM content and working in our LMS.
Thank you for putting it together, providing the entire package including .fla and so nicely commenting your code.
THANK YOU!!!
Elly, you just made my day
Hi Aron,
I have tested your file and it worked supred in reload player!! Do you have a similar example in flash that will work in SCORM 2004 (ver 1.3)environment ?
I am badly looking for it , so will appreciate if you can help me in this.
regards
Samir
Samir,
The Flash part of such an example would look almost exactly the same. The only difference would be in the calls to the Run-Time Data Model.
You’d also swap out the APIWrapper.js file for the APIWrapper.js file for SCORM 2004, which you can get off of ADLNet.gov (if it’s back up).
That all said, I’ll see what I can do about posting a SCORM 2004 version of the same example.
Hi,
thanks for the scormdemo files, is it possible for you to run through the steps to test it in the ADL Content Package Conformance Test (that is, if it is worth using?). I am completely new to this and test suite asks a few questions like whether it is a Content Aggregation Content Package or a Resource Content Package? Anyway i’ve tried both and the test suite seem to take longer than the wait it warns you about.
thanks in advance
Conspirisi,
It’ll take me a couple of days to wipe an environment clean to do it, but I’ll capture how to do this with Camtasia or Captivate and walk through what I’d do to accomplish this.
Basically, the reason why the wait is so long is either that you don’t have the Java RTE configured correctly and/or your content in Flash is dependent on using scripting that requires it being hosted to get around security sandbox issues with Flash and JavaScript.
my apologies aaron,
i was probably jumping in too early with your files. I’ll just run through what I did and my thinking.
My thinking was i got to develop some scorm compliant flash. A good first step use the 2004 conformance test suite 3rd edition, so I downloaded it.
I tested it against their non-flash example zip files. Seemed to work ok – got a load of green ticks, IMS Manifest is Well-formed, etc, etc….
Then I thought I better see if the test suite works with flash content. So I tried using it with your scormdemo.zip. I haven’t touched the zip file I just tested it as is. The test suite just seemed to stall – forever.
I’m up for writing code, but I wasn’t sure where to start with your zip file. Of course this a problem of my naivity and not your files.
Anyway thanks for responding so soon.
HI Aaron
I am not able to download the content. Can you pls check
Regard,
Rk
I am using a LMS with SCORM. I have 1500 users. What I wanna do is to distribute my flash movies in 84 centers and get users to consume flash (swf) fom mapped drive. How can I do this.
Suraj,
I’m guessing you’re using something Open Sourced like Moodle, because with any proprietary LMS they would provide you with some of the IT support you need to solve this problem.
I can answer this question at a high level, but understand that I’m not an IT guy. I’m the guy who goes on smoke breaks and out for beers with IT guys. You want to set up a content server — possibly several depending on how distributed your 84 centers are — like if it makes sense geographically to have several servers spread out to reach them all.
Depending on your LMS and the power of the actual box it sits on, 1500 users shouldn’t be a big deal. They’re not going to hit the LMS concurrently, and if you’re planning on doing something concurrent with 1500 users… you should be thinking about something other than SCORM (more like WebEx or Adobe Connect). You can probably get away with a single LMS server and one or more mirrored content servers.
You’ll need to set up server rules to route content use by IP range, and that way everybody hits the LMS, which then chooses from which content server you’re getting delivered the content. I would guess that most enterprise-level LMSs can handle something like this. And even Moodle — I’d guess you could check the boards and find someone who’s done what you’re looking to do.
I hope this helps. Actually, I hope I just didn’t tell you what NOT to do
Hi Aaron,
Seriously, I think you are THE most helpful SCORM support poster. I really appreciate it!
What does your scormdemo course look like packaged for the LMS? When I used Reload, I did NOT import the xsd files. Are these required for communication with the LMS?
Thanks for all your help!
That .zip file is ready to be imported into the LMS. What you see there is what it looks like straight out of Reload.
The .xsd files are needed by the LMS. They define the metadata schemae as identified in the manifest. no .xsd files and it won’t work.
Hi Aaron,
Just to say big thanks for the example. I have been bashing my head against my keyboard for a while now trying to get my project SCORM working, and then I found this and now things are looking a little bit happier in the I.T world.
Thank you!!
Hi great post.i was wondering…where should the api file be? I get the api message when its uploaded to my server? is there something i can download?
The other question i have is…is the source code free? Can it be edited and used?
P.s this has been by far the best resource online.
Regards
Alan
Katy, thanks a lot.
Alan,
The APIWrapper.js file can really be anywhere in your content package as long as you reference it correctly in your HTML.
If you’re referring to the API for SCORM from the LMS, an LMS will provide that API. If you run this straight up on your regular ol’ webserver, you’ll get a bunch of alert messages letting you know that it can’t find the API… which is right because, um.. you won’t have one outside an LMS.
As far as the source code, it’s free and open to use. It’s provided as is all content on the site via a Creative Commons License that’s good for commercial uses, provided you a) Attribute the original work to me and b) share alike any modifications or enhancements to the work. You can read more about the license here.
By sharing-alike, you don’t have to open up your whole content to the world to see… just anything you modify as far as the SCORM stuff… you know, so that this body of work gets better and better through use.
If you’d like to donate toward my Nintendo Wii fund, I’ll humbly accept donations.
Hi again Aaron,
I’ve been having the most frustrating time trying to implement the JavaScript/Flash Integration kit, so here I am, back to ExternalInterface. I was wondering why the example you created does not load successfully into the ADL Test Suite. Am I doing something wrong?
Shannon
Hi Shannon,
Do you have your security sandbox settings correct?
Probably not, being that this is the first I have ever heard of “Security Sandbox”.
Is this what I should do: “To set this permission level, select Publish Settings > Flash, and then select Access Network Only from the Local Playback Security pop-up menu.” (Flash online help).
Oh my gosh!!! I just tested your example in the trial LMS I am using. It worked! I’m giddy…
I hope I can duplicate your demo…
Shannon
Shannon,
There’s a good article on Adobe about the security settings that began with Flash Player 8:
http://www.adobe.com/devnet/flash/articles/fplayer8_security.html
What you’ll want to do is basically designate your C:/ drive (or wherever your content and the test suite are) as a safe zone. Restart your browser. That should be all you need to do.
Basically, without designating that Flash is allowed to execute scripting on your local drive (from your local drive), you’re not allowed to talk to javascript in the browser, which makes the whole SCORM testing thing impossible.
You can adjust your security sandbox areas here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
So the package you created uploads and runs successfully in my trial LMS. When I use Reload to package the same thing (except I omit the .fla), the course cannot import. I compared the manifest files and, yes, they are different. So far, I haven’t been able to duplicate the steps you used to create your manifest.xml. Is it too much to ask for you to specify the steps you used to create the manifest in Reload?
Shannon
Shannon,
Which version of Reload Editor are you using? I’ll first test out your version and then attempt to walk you through it.
I had an issue with every content package I put together with some version of Reload Editor now that I’m thinking of it, but for the life of me I can’t remember the reason for it.
You’re so very kind. The folder says “ReloadEditor202_ManualInstall”.
Hope that helps!
Shannon
Hello Aaron,
I wrote a comment and then lost my connection so I don’t know if it got through to you. If this is a repeat, sorry about that!
I want to echo the gratitude that others have expressed for sharing your knowledge with us! I have been a flash developer for several years but am brand new to SCORM. It was a lot slower going before I found your site.
I have a flash CS3 program that is complete and now needs to be SCORM 1.2 compliant. I am using the External Interface class and it is working fine in the sample RTE. My question is whether there is a comprehensive list of all SCORM data elements somewhere? I saw that poster on the Rustici site, but am wondering if there is something for SCORM 1.2?
Thanks!
Aneliese
Hi Aaron,
In creating a SCORM compliant course, i was only able to communicate with the LMS using fscommand and publishing the file for flashMX 2004.
I’m told I need to set this course up for bookmarking. I can successfully send a setValue number (cmi.core.lesson_location) call and receive a getValue number(cmi.core.lesson_location) call per the ADL SCO conformance test suite. I just dont know how to send the learner to the frame where they left the course.
Do you have any insight?
Thanks,
Shannon
Thanks for this Aaron! I have searched so much of the web looking for an explanation like this of how to use Flash with an LMS. You are an absolute legend!
Hey aaron, i just have one question. I’m having a problem with the exit button. When its used in Moodle the exit button appears to do nothing . . . . what have i done wrong?
thanks
Hey Aaron, a great example. You really rock!! Spent lots of time searching for simple scorm stuff…finally got urs…Thanks so very much.
What way do you use to send infos to a LMS server via JS ?
Hello Aaron,
I have used the following link to run javascript calls locally with the SCORM RTE. It also works with Flash Player 9, and is a great solution when you have a computer that cannot access the internet to add trusted sites.
http://www.whenpenguinsattack.com/2006/07/13/flash-8-and-security/
Yeah so i downloaded the ExternalInterface and i am still not getting it to work i am getting this error.
“LMS Communication Initialized: null
”
Initialized Failed
I am running the ADL test sweet and its not working. Is there something i need to do to get it to initialize.
Nigel,
Please look at Comment #4 above.
Hello Everyone!
Has anybody tried this package on WebCT(Blackboard) Vista? When I tried to upload the SCORM module to WebCT I got the following msg:
The package could not be imported because it is not compliant with SCORM content packaging requirements; imsmanifest.xml must be at the root of the package.
Your help would be most appreciated!
Hi Stuart.
To solve the exit button problem, in the interface layer, change the exit_btn code to the following.
The course needs to be opened via the HTML file but this will close the window when clicking the Exit button.
exit_btn.onRelease = function ()
{
getURL(“javascript: window.close()”);
};
I’ve loaded this sample into the LMS we are using and have had success up until the point of tracking completion.
Upon entering page 4, completion status should be sent to the LMS correct? I’m wonding why the LMS is not showing the course as complete but still active.
I’ve tried both w/ the exit button programmed as in origianal demo and w/ code above and w/ the original code, not only does it not close the window, but a IE alert comes up saying “Not Terminated”.
I’m wondering why the exit button is not working and why the course is not tracking completion.
Nevermind my previous comment. User error, or really not knowing this new LMS we’re using. Thank you so much for posting this! It works great!!!
Nicole
Hi,
“…
i imported de scorm file “scormdemo.zip” to WebCT Vista 3.0 LMS. Using IE6 it works fine… but using firefox 2.0 i get “LMS Communication Initialized: null
Initialized Failed
Hi Aaron,
This is great – just about the only useful and working example I can find!
Is there a particular benifit / reason as to why you’re using the JavaScript & functions you are – as opposed to those functions that Flash can autogenerate for you?
Thanks, James.
There’s a couple of reasons for this, but basically it comes down to history and use.
Flash’s SCORM code that it provides out of the box are great — if you’re using Flash’s built in E-Learning templates. It’s not so great if you’re trying to roll your own types of interactive content. Then — and this is probably more of a historical perspective than anything I’ve really researched anew — their provided code becomes a lot harder to use, because you’re not working in the context in which they were intended for.
At that point, it becomes a lot easier to use proven JavaScript methods (like those provided by ADL themselves, or by another vendor like Rustici Software and use Externalnterface to build whatever kind of SCOs you want — advanced assessments, games, performance simulations — whatever.
Thanks a ton!
I was up and running with my course within 5 minutes of integration effort.
Cheers !
Hi Aaron,
I have a LMS developed based upon java content and now I wish to have the lms communicating with the flash content.
I have compared the apiwrapper.js in both cases and the one based on your example got some new stuff such as the error handing.
How do I make my lms work with the flash content then.
Do I need to create a launcher file which will execute the imsmanifest.xml and the apiwrapper.js?
I really need to have some light on those issues.
Big Thanks
Hi. Just wanted to say what a great resource this is. I have always done my SCORM courses in Authorware, but now the boss wants everything in Flash. Needless to say, without your wonderful example, I would be at square one still. I do have a question, as I am sort of new to Flash…how would I change the buttons from your example? I see that they are not symbols but instances of “button” If I were to create “new” buttons, and name them the same as what you have, would they work the same? Even if they were symbols with the four different button states?
Thank you
Amanda
Hi,
First of all I would like to thank you for so great documented method for applying scorm into Flash-based content.
And now my problem
I’m currently working on the e-learning course (developed in Flash) which will be running on IBM WCL platform. Since it’s my first time with this plaform I ran some test using your “Scorm Demo”. I tried different browsers, but every time the only result I got was:
“LMS Communication Initialized: undefined
”
Initialized failed
Does anyone across such a problem when working with this particular platform (IBM WCL)/or have any idea how to solve it? Does this platform need special solution to communicate effectively with course using SCORM?
Thank you,
Piotr