Home > Learning Center > Tutorials > Developing Flash eLearning Content for Use in Connect Pro
Developing Flash eLearning Content for Use in Connect Pro
Andrew Chemey, Adobe Systems
January 2009
Expertise Level: Advanced
3 Votes
This article which includes example files can be used as a prototype to illustrate how Flash-based content can be launched and tracked in Adobe Connect Pro (Connect Pro).? This prototype allows developers to load a pre-compiled SWF (Tracking SWF) in Flash-based content.? Once loaded, developers call some simple methods to retrieve or send data with Connect Pro.?
This article describes the use of a pre-compiled Tracking SWF; how to load the SWF and call its methods.? This article does not provide the ActionScript or source for the tracking file.? By using this tracking SWF, developers don?t need to know about the AICC standard.? Developers just need to know how to use the methods contained within the tracking SWF to communicate with Connect Pro.? In addition, the name and functionality of the methods contained in the tracking SWF mirror methods found in some of the other articles / prototypes available, such as SCORM-to-Connect and HTML/Javascript-to-Connect.? For developers that want to completely ?roll their own? tracking in Flash, and don?t want to use a pre-compiled SWF - a separate article is planned that demonstrates building a basic tracking mechanism using Flash ActionScript and the sendAndLoad method of the LoadVars Object.?
Note:? The Tracking SWF is based on ActionScript 2.0 and is not currently available in ActionScript 3.0.? The current version of the Tracking SWF can not be loaded into any Flash project that uses ActionScript 3.0.? This version of the Tracking SWF also requires Flash Player 8 or higher to use.
This is a prototype, simply because there are many ways to communicate with Connect Pro using Flash-based content.? I have demonstrated at least four different mechanisms that can be employed to communicate from Flash to an AICC-compliant LMS.? This includes, though not exclusively, Java (via JavaScript), JavaScript, Server-Side scripts (e.g. ASP, JSP, CGI, etc) and through Flash directly.? In case it wasn?t known, developing for the SCORM standard requires a JavaScript implementation, while Adobe Connect Pro follows the AICC standard for content communication.
There are a series of other articles I have written for different types of content, including HTML/Javascript, Authorware, Presenter, Captivate and SCORM-to-Connect.? Please review the different articles and examples, based on the content tool(s) being used to develop content.? They might provide the functionality required ?as-is? for your needs or give you information on how to develop your own tracking mechanism.
This Flash-to-Connect prototype follows the requirements of content, in general, for use in Adobe Connect Pro.? Content that is imported into Adobe Connect Pro needs to be a single Assignable Unit (AU), or in the case of SCORM, a single Shareable Content Object (SCO).? Adobe Connect Pro does not import content that contains multiple AU?s in a single package.? Connect Pro includes support for Curriculums, which allows you to create the same effect.? However, the content needs to be separated into individual AU files at import into the Content tab.
Requirements
- Flash 8 or higher
- Flash Player 8 or higher
- Familiarity with ActionScript is recommended
- Adobe Acrobat Connect Pro account
- Sample Files associated with this document are available for download (briefly described in the Sample Files Description section, below).? Some of these files have been compressed in .zip format and may require you to install an extraction program such as 7-Zip available from http://www.7-zip.com.
- Flash to Connect Prototype (ZIP, 481KB)
- Flash to Connect Installation (HTM/SWF, 3.50MB)
- Flash to Connect Walkthrough (HTM/SWF, 15.7MB)
- Flash to Connect An Example: As created in Walkthrough (ZIP, 150KB)
- Flash to Connect Sample 1: Packaged for Adobe Connect (ZIP, 182KB)
- Flash to Connect Sample 2: Packaged for Adobe Connect (ZIP, 183KB)
- Flash to Connect Sample 3: Packaged for Adobe Connect (ZIP, 155KB)
- Flash to Connect Samples Source (ZIP, 1,634KB)
Overview
This prototype provides a single file ?tracking.swf? which performs the communication with Adobe Connect Pro to send/retrieve data.? Typically communication occurs at least twice when communicating with an LMS, such as Connect Pro; once in the beginning (to retrieve data) and at least once at the end (to send data).? Content can send data a more often to Connect Pro, based on individual needs and requirements.?
The type and format of data that can be sent to Connect Pro follows the AICC-HACP standard and includes:
- Retrieving general data from Connect Pro, such as location (bookmarking data), status (incomplete, completed, passed, failed), score and time.? This is known, in AICC command terminology as ?GetParam?
- Sending general data to Connect Pro such as location, status, score and time.? This is known, in AICC command terminology as ?PutParam?
- Sending interaction-specific data to Connect Pro, such as an ID to identify the interaction, the type of interaction, latency (how long it took to answer the question), whether the learner answered the question properly, etc.? This is known, in AICC command terminology as ?PutInteractions?
- Terminate the communication with Connect Pro (though this is NOT necessary for tracking to work properly with Connect Pro).? This is known, in AICC command terminology as ?ExitAU?
?
Using this prototype, developers only need to know to use the Tracking SWF to integrate any Flash-based content with Connect Pro.? This document does not provide an overview of the AICC standard; however, it does attempt to cover how the properties and methods of the Tracking SWF are associated to these AICC commands.?? For a better understanding of the AICC standard, please review articles and documents available at:
- AICC Website: http://www.aicc.org
- Creating AICC content for Connect Pro: http://www.adobe.com/resources/breeze/training/articles/aicc_compliant.html
?
This article describes building Flash-based content for use in Adobe Connect Pro.? Flash-based content is limited to any restrictions by the Flash Player.? In general, it is expected that developers reading this article are creating content for Adobe Connect Pro and will be importing content into the Content tab of Adobe Connect Pro.? In this primary use-case, there are not any domain restrictions in the AICC communication between Connect Pro and the content.? To be clear, content imported into Adobe Connect Pro tab and subsequently launched from the Adobe Connect Pro server will not have any cross-domain issues in communicating with the same Connect Pro server.? Therefore, this article does not include a section on cross-domain communication or issues related to a cross-domain environment.? Any developer that plans to store content on any other server, or have the content stored on the Adobe Connect Pro server and launched/tracked from another LMS may experience cross-domain issues. These issues may be explained or resolved in other articles such as:
- Output Options in Presenter :? http://www.adobe.com/resources/breeze/presenter/articles/output_aicc_04.html#cross
- Flash Player Security Restrictions: http://www.macromedia.com/devnet/mx/flash/articles/fplayer_security.html
?
Using the Flash-to-Connect Prototype
This Flash prototype is an external pre-built Flash SWF file that uses the AICC standard to communicate with Connect Pro.? The Tracking SWF provides a set of methods and properties that Flash developers use to communicate data with Connect Pro.?
To use this Tracking SWF, you simply need to perform a few steps:
- Extract (unzip) the contents of the prototype into a folder
- Load the Tracking SWF file into a Flash project
- Use the methods of the Tracking SWF to communicate data with Connect Pro
- Publish the Flash project, using an HTML Template found in the Samples Section
- Compress (zip) the root files of the content that uses the Tracking SWF
- Import resulting zip file into the Content tab of Adobe Connect Pro
Loading the Tracking SWF
In order to be used, the Tracking SWF needs to be loaded into any Flash files that want to communicate with Connect Pro.? Tracking SWF (also referenced as tracking.swf) is loaded using the standard ActionScript, similar to:
loadMovie(?tracking.swf?);
After the Tracking SWF is loaded, it is used to initialize communication with Connect Pro and retrieve data (using the GetParam Command) and subsequently send data to Connect Pro.? The Tracking SWF is typically loaded before the content files are displayed to the learner.? Because this is a Flash-based tracking mechanism, the actual SWF file and its methods might not be loaded or available by the time the next line of ActionScript is executed after the loadMovie method is called.? Some kind of preloader or polling mechanism should be utilized to wait until the Tracking SWF is fully loaded, before any attempts to calls its methods or properties should be made.
The Tracking SWF is typically loaded before or in the beginning of the first Flash file (if there are multiple files) and then a global object is created which is used to send/retrieve data from Connect Pro.? The Tracking SWF should be loaded before the first content file is displayed, because the content might want to know if the learner has launched this content before.? If the learner has launched this content before, there may be ?state data? or information that indicates where the learner left off; what sections were completed or pages viewed; how they answered individual questions, etc.? When a learner launches the content for the first time, the content is expected to start at the beginning.? On subsequent launches, the learner may expect to be returned to the location they left off in their last previous attempt.? Of course, there may be other rules determined by need and requirements that determine where a learner leaves off; so if perhaps a learner leaves in the middle of a quiz, they are returned to the beginning of the quiz and not in the middle or the question they left off.?
So, by loading the Tracking SWF before or in the beginning of the first file, the learner may be returned to the location they left off in previous attempts.? There are different means to communicate with Connect Pro, but since any communication from the Tracking SWF to Connect Pro back to the Tracking SWF might not be immediate, once again a polling mechanism must be employed.? We can expect to wait for the response from Connect Pro for the request to get data from Connect Pro ? so it can be parsed and then used to return the learner where they left off.
As part of the prototype files provided for download with this article, a series of ?Tracking Library (Component)? files have been included for Flash 8, 9 and 10 (or Flash 8, Flash CS3 and Flash CS4).? These ?component? files should be installed in the Common Library so they can be made available for any Flash files that will communicate data to Adobe Connect Pro.? The Component imports the Tracking SWF and handles the loading of the tracking data and the communication of the tracking with Adobe Connect Pro.?

Figure 1: Adobe Connect Pro Tracking Component
The Connect Pro Tracking Component uses a simple loading mechanism for both the loading of the Tracking SWF and waiting for the data from Connect Pro to be returned/parsed.? This simple mechanism can be used for all Flash-based content.? The various example files each demonstrate different mechanisms for using the Tracking SWF within your content.? The examples are explicitly described in a section, later in this article.? The basic premise is the same, however:
- A layer called ?Connect Tracking? is implemented in the Flash file
- The Connect Pro Tracking Component is available in the Connect Tracking layer
- A simple mechanism to wait for the Tracking SWF to communicate with Connect Pro, retrieve and parse the data
- The Tracking SWF provides a global object (called ?tracking?) with various methods and properties that are called by the content to access the data from Connect Pro or send data to Connect Pro.
Note:? By making a global object called ?tracking? the communication with Connect Pro is available in *any* SWF file, even if the loadMovie overrides the original Flash file that loaded the Tracking SWF (e.g. using _root.loadMovie(?newFile.swf?), as demonstrated in Example 2, of the example files).

Figure 2: Connect Pro Tracking Component on Stage
Waiting for a response
Because Tracking.swf is an external file ? it needs to be loaded into Flash before it can be utilized.? The examples provided don?t utilize a full pre-loader ? but they do wait until it?s fully loaded, before attempting to call any methods or use any properties of the SWF.?
Adobe Connect Pro follows the AICC-HACP standard, which uses HTTP-POST to communicate data with Connect Pro.? The implementation of the HTTP-POST in the Tracking SWF doesn?t return a response immediately.? For example, the method getTrackingData() in the Tracking SWF starts the process to request a GetParam to Connect Pro.? However, this code would not return any data, such that (in the example below, data_var does not contain the response from Connect Pro):
var data_var = tracking.getTrackingData();
The method ?getTrackingData? issues an HTTP-POST to Connect Pro, a response has to be returned and then the response has to be parsed.? The code to call
getTrackingData()
and wait for a response is found in the Tracking Component and in the example files.?
There are two parts to the loading of the Connect Pro Tracking Component.? There is a bit of code that is part of the Tracking Component which loads the Tracking SWF and then retrieves the Tracking Data, if appropriate (if the content is launched from Connect Pro).? This simplified snippet is the code found in the Tracking Component:
this._visible = false;
// Start loading of tracking SWF (if appropriate)
if(isTrackingMCLoaded == undefined)
{
???? this.createEmptyMovieClip('LMSTracking_mc', 0);
???? LMSTracking_mc.loadMovie("tracking.swf");
???? isTrackingMCLoaded = true;
???? startToWaitForTracking();
}
function startToWaitForTracking()
{
???? var waitInterval_var = '';????????? // Interval; interval variable
???? var waitInterval_int = 15;????????? // Interval; Number of seconds to wait
????
???? waitInterval_int = waitInterval_int * 1000;
????
???? waitInterval_var = setInterval(waitForTrackingLoad, 100, waitInterval_int + getTimer());
}
????
function waitForTrackingLoad(_waitInterval_int)
{
???? // Wait to initialize for 15 seconds (more than enough time for API to load and LMS to initialize)
???? if (typeof(tracking) != 'undefined' || getTimer() > _waitInterval_int)
???? {
????????? clearInterval(waitInterval_var);
?????????
?????? ???if(tracking.isInitialized())
????????? {
?????????????? // This only affects SCORM communication, anyway.
?????????????? tracking.setShowErrors(0);
?????????????? // Get Tracking Data
?????????????? // This could have been called automatically from the Tracking SWF, but in case developers
?????????????? // wanted to control when the data is retreived from the LMS, it's been made an explicit
?????????????? // external call, made here.
?????????????? tracking.getTrackingData();
????????? }
???? }
}
stop();
The second part to loading data using the Tracking SWF is waiting for the tracking code to be fully loaded, so it can be used.? Once the tracking data is loaded (e.g. tracking.isTrackingDataLoaded() == true) then the various getTracking methods are available.? This snippet is taken from one of the example files:
var lmsData_str = "";
var lmsLocation_str = "";
var lmsIsInitialized_bln = false;
var lmsStudentID_str = "";
var lmsStudentName_str = "";
var lmsStatus_str = "";
var lmsScore_int = 0;
var intervalLMS_int = 15? // Number of seconds to wait for tracking component to retreive data from Connect Pro
var intervalLMS_var = setInterval(waitForLMS, 100, getTimer() + (intervalLMS_int * 1000));
function waitForLMS(timeout_int)
{
???? if (getTimer() > timeout_int)
???? {
????????? LMSisLoaded();
???? }
???? if ( tracking.isInitialized() != undefined)
???? {
????????? if(tracking.isInitialized())
????????? {
?????????????? if(tracking.isTrackingDataLoaded() == true)
?????????????? {
??????????????????? LMSisLoaded();
?????????????? }
????????? } else {
?????????????? LMSisLoaded();
????????? }
???? }
}
function LMSisLoaded()
{
???? clearInterval(intervalLMS);
???? // Get data from LMS
???? lmsData_str = tracking.getLessonData();
???? lmsLocation_str = tracking.getLessonLocation();
???? lmsIsInitialized_bln = tracking.isInitialized();
???? lmsStudentID_str = tracking.getStudentID();
???? lmsStudentName_str = tracking.getStudentName();
???? lmsStatus_str = tracking.getLessonStatus();
???? lmsScore_int = int(tracking.getScoreRaw());
????
???? // Do something with data (like resume if necessary)
}
stop();
Not all methods in the prototype require a polling mechanism to wait for a response with Connect Pro.? Only the methods that actually perform an HTTP-POST may require a mechanism to wait for a response.? The following methods in the prototype, which are explained later in this document, initiate an HTTP-POST:
tracking.getTrackingData();
tracking.sendTrackingData();
tracking.sendTrackingDataDelta();
tracking.sendInteractionData();
tracking.sendExitData();
In the example files provided, only two of these methods utilize the waiting mechanism: ?getTrackingData? and ?sendExitData?.? These methods require a mechanism to wait for a response, because we need to know the response is completed in the beginning (when getTrackingData is called), before the content is launched and at the end (when sendExitData is called), before attempting to close the browser window.?
?
Methods
This section covers some of the methods available in the Flash Tracking SWF prototype.? It won?t cover all of them, because some are used for internal purposes.? However, it will attempt to describe the most common methods and properties used by the example files.
There are two major types of methods: Get and Set methods.? The bulk of the Get methods return specific information from the LMS.? The Set functions send data to the LMS.?
The method tracking.getTrackingData() is used to actually perform an HTTP-POST to the Connect Pro server to retrieve all of the data at once.? When it has successfully received a response, the Tracking SWF parses the response and updates the properties (not necessarily exposed in this document) with the data from Connect Pro.? When it is finished parsing and updating, tracking.isInitialized() returns true.? The Tracking Component itself calls tracking.getTrackingData() and the example files (and code above) show how to wait for the tracking data to be loaded, before it can be used.? Once loaded, however, the rest of the Get methods available for use, without directly communicating with Connect Pro, such that calling:
var myStudentID = tracking.getStudentID();
would set the variable myStudentID with the value of the Student ID from the LMS.
Similarly, most of the set methods do not update the LMS with the data.? They are stored locally until one of the following methods is executed:
tracking.sendTrackingData();
tracking.sendTrackingDataDelta();
tracking.flush()
tracking.finish();
The properties/methods described below are all prefaced with ?tracking.? before utilizing.? For example, the actual method for retrieving the lesson location from the LMS is: tracking.getLessonLocation();
Tracking Methods
|
Method |
Parameters |
Description |
|
isInitialized |
None |
It is used to determine whether the LMS is initialized.?
|
|
isTrackingDataLoaded |
None |
Used to determine whether the tracking object has communicated with the LMS and retrieved all of the tracking data.
|
|
getLessonLocation |
None |
Lesson Location as stored by the LMS.
|
|
getLessonStatus |
None |
Status as stored by the LMS. Returns: String |
|
getSuccessStatus |
None |
Success status (passed or failed) as stored by an LMS.? This method is included for SCORM 2004 support. Returns: String |
|
getScore |
Boolean |
Score as stored by the LMS. Returns: String (since it may be in format of ?raw, max, min?). |
|
getScoreRaw |
None |
Raw score as stored by the LMS Returns: String (raw score) |
|
getScoreMax |
None |
Max score as stored by the LMS Returns: String (max score) |
|
getScoreMin |
None |
Min score as stored by the LMS Returns: String (min score) |
|
getTimeInSession |
None |
Time spent as stored by the LMS. Returns: String (HH:MM:SS) |
|
getStudentID |
None |
Student ID as sent by the LMS. Returns: String |
|
getStudentName |
None |
Student name as sent by the LMS. Returns: String |
|
getLessonData |
None |
Used to retrieve ?resume? or ?lesson? data from the LMS, as sent by the content in previous sessions.? This is used to retrieve state data. Returns: String |
|
setLessonLocation |
String |
Set?s the location where the learner is currently. |
|
setLessonStatus |
String (completion status), Note: Success Status is optional and only used in SCORM 2004.? |
Set?s the learner?s status.? Should be one of: ?incomplete?, ?completed?, ?passed? or ?failed? (all lower-case). If using Completion and Success status fields: Completion Status should be either ?completed? or ?incomplete?; and Success Status should be either ?passed? or ?failed?. |
|
setScore |
Integer (Raw Score), |
Set?s the learner?s score. ? Use the optional Min and Max fields if necessary (and the LMS supports them). |
|
setTime |
String (HH:MM:SS) |
Formatted time.? This parameter isn?t necessary, as the TrackingSWF will determine the time automatically.? Use this to override the timer. |
|
setLessonData |
String |
Send ?resume? or ?lesson? data to store in the LMS.? This can be as much as a blob-field or whatever the LMS can store for this field.? Content determines the format and type of data to send. Note: Remember this data is sent as a string, so arrays and other datatypes are implicitly converted to strings. |
|
flush |
None |
Flushes or forces data to be sent to the LMS.? Each of the calls above won?t immediately send the data to the LMS, unless flush or finish is called. |
|
finish |
String (JS method to call), |
Flushes or forces data to be sent to the LMS, but also terminates the relationship with the LMS.? By setting the optional String parameter, a JavaScript method is called when the tracking data is ent to the LMS.?For example: tracking.finish(?alert?, ?hi, mom?); Would cause an alert message to appear after the tracking data is sent to the LMS and the session terminated. |
|
sendTrackingData |
Integer (Raw Score), Note: Parameters are optional, assuming the individual values have been set (e.g. setLessonLocation()). |
This method sends the tracking data to the LMS, as based on the current values of the appropriate data.? The data can be set using the ?set? methods in this prototype, or by passing as optional parameters to this method. For example, calling: setScore(25); has the same effect as calling sendTrackingData(25,0,100?); Score As Percent indicates whether to send score to Connect Pro as a percent (e.g. ?25?) or Raw,Min,Max (e.g. ?1,0,4?). Status Preference determines whether to send score as a completion (incomplete/completed) or success (passed/failed). Resume Data is the same as Lesson Data description, above. |
|
sendTrackingDataDelta |
Integer (Raw Score), |
This method sends the tracking data to the LMS, based on the data that has changed since the last time data was sent to the LMS.? This method is really only used by the SCORM standards, though can be called instead of sendTrackingData method and in AICC/Connect environments is treated the same as sendTrackingData. The data can be set using the ?set? methods in this prototype, or by passing as optional parameters to this method. For example, calling: setScore(25); has the same effect as calling sendTrackingData(25,0,100?); Score As Percent indicates whether to send score to Connect Pro as a percent (e.g. ?25?) or Raw,Min,Max (e.g. ?1,0,4?). Status Preference determines whether to send score as a completion (incomplete/completed) or success (passed/failed). Resume Data is the same as Lesson Data description, above. |
|
sendInteractionData |
String (Interaction ID), |
Sends interaction data data to the LMS. This simply tells the LMS how the learner answered individual questions.? sendInteractionData not only updates the interaction array, but sends the data to the LMS.? A corresponding method ?setInteractionData? only updates the interaction array. InteractionID is a unique identifier for each question.? Objective ID can be sent as 0 if you aren?t tracking objectives in the LMS.? Type is the type of interaction and should be one of:? true-false, choice, fill-in, matching, performance, sequencing, likert, numeric. Responses are how the learner answered the question. Result is either ?correct? or ?wrong?. Weight is the relative importance of the question (typically 1). Latency is the time in seconds the learner took to answer the question.? Date and Time are determined and formatted for you, so they can be passed empty or null strings. |
|
sendExitData |
None |
Terminates relationship with LMS (by calling the AICC ?ExitAU? command). |
Prototype Files
The prototype is a relatively simple solution and is also relatively easy to use.? You can certainly incorporate the Tracking SWF into your own Flash files and simply call the available methods from your Flash-based content.? This section will review the various files that comprise this Tracking SWF solution.
Note:? At this time, there isn?t an installer, though that may change in the future.? Please review the Installation Walkthrough available in the Sample Files section, above for information on how to install (copy) the various parts, for ease-of-use of the Tracking SWF.
Here are the files of the prototype:
- HTML Template (File)
- Tracking Library Component (File)
- Tracking SWF (File)
?
HTML Template
The HTML Template file is the launch file for each of your Flash-based files.? It is a ?template? which means it should be copied to the HTML folder where Flash is installed.? Once copied properly, it is available from the HTML tab of the Publishing dialog in Flash.? This file can be modified to include additional methods and properties specific to the custom content that is being developed.? Two versions of the template have been provided.? The HTTPS template is used for publishing to Connect Pro servers that are hosted on secure (HTTPS) servers.?
Note: The HTML Template may need to be manually copied/installed to different locations, based on the version of Flash and the OS you are using.? I thought you could use the FirstRun directory where Flash is installed (on Windows that would be in a subfolder of the Program Files directory), but that doesn?t seem to be the case, according to this technote for Flash 10:? http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSd60f23110762d6b883b18f10cb1fe1af6-7bb4a.html.? If the HTML Template does not appear in the Publish Settings dialog, copy the template file to the appropriate Templates folder based on your version of Flash and OS.
Tracking Library Component
These are ?Common Library? files.? They should be copied to the Common Library folder where Flash is installed.? Once copied properly, the library is available in the Window > Common Libraries palette.? The components load the Tracking SWF and instantiate the communication with Connect Pro.? Once loaded, the Component provides a global tracking object with the methods and properties described in this article.? This
Tracking SWF
This file is an external SWF which provides the methods and properties to communicate with Adobe Connect Pro.? This file is loaded via the Tracking Library Component, though any Flash file can simply use the loadMovie method to load this SWF and make the methods and properties available.?
?
Importing content into Adobe Connect Pro
If you are importing a single content file (e.g. PDF, HTM, etc) the file can either be imported individually or compressed in zip format.? This section only pertains to multiple file courses which are to be imported into Adobe Connect Pro.? Because the tracking SWF will comprise of at least an HTM file, the Tracking SWF, and the content SWF, this section most certainly applies to content created using the Tracking SWF prototype.
Importing content into Adobe Connect Pro is documented in many places, including here:? http://help.adobe.com/en_US/AcrobatConnectPro/7.0/WS76BDB2C9-24A2-4d4d-B8C2-EAE1A26603F4.html#WSDF93E779-D109-4d12-A66D-29FAC2F03B6B.? There is more information available on importing content into Adobe Connect Pro, including documentation written by me, which can be searched in Adobe.com or the web in general.
To create a valid zip file for importing into Adobe Connect Pro, the files need to:
- contain a single HTM or HTML file in the root of the zip file; OR
- contain either a file called ?index.htm? or ?index.html? in the root of the zip file
Note:? There are other potential intricacies for properly recognizing file types when importing into Adobe Connect Pro. This may include requiring only a single HTM and single AAM file in the root of the zip file, in order for Connect Pro to recognize the content type as ?Authorware?.? However, that?s not discussed in this document.
The HTM file created by using the Tracking SWF HTML Template should be the launch file for any custom Flash-based content using the Tracking SWF.? This is the file that Adobe Connect Pro will launch when the content is imported and subsequently launched from Connect Pro Content or Training tabs.? If the root of the published files does not contain any other HTM files, its name isn?t that important.? However, you need to make sure that this launch file is contained in the root of the zip file.? This means you need to open the folder containing the Prototype files and select all of the files/folders before creating a zip file.? Do NOT compress or zip up the parent folder itself.? If the published files contain more than one HTM file, the launch file should be named ?index.htm? or ?index.html?.
Please review the format of the example file found in the Sample Files section, above, for the structure of a valid zip file which can be imported into Adobe Connect Pro.
Parsing Tracking Data
This section is a reminder when parsing data that was retrieved from Connect Pro.? In most cases, developers are asked to create a file that in addition to sending data such as score, and status to Connect Pro also sends ?bookmarking? data.? This allows learners to return to the location where they left off (or some related location because, for example, sometimes a learner is taken to the beginning of the quiz to retake the quiz, instead of being taken to the middle of the quiz where they left off).? However, in addition to taking the learner where they left off, it is often required to remember ?state? data or what state the learner left the content.? A simple example might be to remember what pages the learner viewed.
Simple Array
A great way to remember the pages viewed is to use a simple array.? In this example, imagine if the content consists of 3 pages (or frames) that need to be viewed.? An array might be created to store values for when the learner has completed all of the pages.? I tend to use the following values:
|
Value |
Definition |
Description |
|
-1 |
Not Viewed |
Default for all pages in the content.? This value means the learner has not even attempted to view this page. |
|
0 |
Viewed (not Completed) |
Used to represent a page that contains something the learner needs to interact with.? If there is a question on the page the learner needs to answer, etc.? If they have not completed all of the required interactions on that page, the value is 0. |
|
1 |
Viewed (and Completed) |
Once the learner has completed all of the interactions on a page, the value is set to 1.? If the page simply contains text, the value could be set to 1 immediately upon entering the page. |
Since there are three pages in this example, then a variable (which is defined as pagesViewed_ary) is initialized as:
var pagesViewed_ary = [-1, -1, -1];
When a learner views the first page in the content, the array is updated such that:
pagesViewed_ary[0] = 1;
Note:? Arrays in ActionScript are 0-based, so the reference to the first item in the array starts at 0.
In our example, let?s assume that the learner completed the first page, and navigated to the second page when they exited.? We?ll introduce a new variable currentPage_int which contains the current page the learner is at.? This might get a bit confusing, because we are going to make currentPage_int 0-based, as well, though normally frames are 1-based.? This makes it easier to translate the current page with the pages viewed in the array.? At this point, we?d expect our variables to be set as follows:
currentPage_int = 1;
pagesViewed_ary = [1, 1, -1];
Since we want to remember what pages were viewed by the learner in this session, we?ll want to send the array to Connect Pro.? The methods to call to store this kind of data would be something similar to:
tracking.setLessonLocation(currentPage_int);
tracking.setLessonData(?pagesViewed_ary=? + pagesViewed_ary.toString());
Where the current location is sent as the ?lesson location? and the additional state data is sent as ?Lesson Data?.? The actual value sent to the Lesson Data is:? ?pagesViewed_ary=1, 1, -1? (it doesn?t contain brackets or any other formatting).
Assuming the learner exits at this point, we are now going to look at what it takes to update all of the information the next time the learner launches the content from Connect Pro.?
While it isn?t necessary, assume the following method is available to grab name/value pairs from a string:
function getParameter(search_str, name_str, delimiter_str)
{
???? var value_str = '';
???? var temp_str = search_str;
???? var delimiter_ary = ['&', '\r\n', '\r', '\n'];
???? var temp_int = temp_str.toLowerCase().indexOf(name_str.toLowerCase());
???? if (temp_int > -1)
???? {
????????? value_str = temp_str.substring(temp_int + name_str.length + 1, temp_str.length);
????????? if(typeof(delimiter_str) != 'undefined')
????????? {
?????????????? if(delimiter_str == '')
?????????????? {
??????????????????? delimiter_ary = [];
?????????????? } else {
??????????????????? delimiter_ary = delimiter_str.split(',');
?????? ????????}
????????? }
????????? for(var item_var in delimiter_ary)
????????? {
?????????????? var item_str = delimiter_ary[item_var];
?????????????? if (value_str.indexOf(item_str) > 0)
?????????????? {
??????????????????? value_str = value_str.substring(0, value_str.indexOf(item_str));
?????????????? }
????????? }
???? }
???? return value_str;
}
The method is called getParameter and accepts up to three String parameters:
|
Method |
Parameters |
Description |
|
getParameter |
String (Search String), |
Searches the Search String for a name/value pair (e.g. Name=Value) and returns the value. |
It might be easier to look at an example using the following code snippet:
var name_str = ?fname=Andrew&lname=Chemey?;
var fieldName_str = ?fname?
var firstName_str = getParameter(name_str, fieldName_str, ?&?);
would set
firstName_str
to ?Andrew?.
Returning to our initial example, we need to get the data from Connect Pro when the content is launched.? Assuming we?ve called tracking.getTrackingData() and waited for a valid response and tracking.isInitialized() is true?
var currentPage_str = tracking.getLessonLocation();
var lessonData_str = tracking.getLessonData();
var pagesViewed_str = getParameter(lessonData_str, pagesViewed_ary, ??);
Notice that we defined two variables here:
currentPage_str
and
pagesViewed_str
These variables contain Strings and not an Integer or Array, respectively (e.g. currentPage_str = ?1? and pagesViewed_str = ?1, 1, -1?).?
These values need to be converted to their respective datatypes.? For currentPage_int, we?ll use the Number method and for pagesViewed_ary the split method:
currentPage_int = Number(currentPage_str);
pagesViewed_ary = pagesViewed_str.split(?,?);
Note:? The values in the pagesViewed_ary are also strings and may require conversion to integers, if necessary.
For such a ?simple? array it seemed to take a bit of time to explain the conversions and storage of array data.? However, reading through this section, above, could save hours of pulling hair, if you happen to forget about the conversions that occur as you go from one datatype to another.?
Simple Multidimensional Array
This section serves as a friendly reminder of what happens when you use multidimensional arrays.? In a simple case, imagine if you are using the following array to store in Connect Pro:
var multiDimension_ary = [-1, [-1, -1], -1];
If this array is converted to a string
var multiDimension_str = multiDimension_ary.toString();
it looks like this:
multiDimension_str = ?-1, -1, -1, -1?
It?s impossible to differentiate this string from a number of arrays, including:
[-1, -1, -1, -1]
[[-1], -1, -1, -1]
[[-1, -1], -1, -1]
[[-1, -1], [-1, -1]]
.
.
.
I assume you get the point.? Multidimensional arrays need special consideration when converting to strings.? Whether a different delimiter is used for each dimension or some other mechanism is used, is up to you.
Debugging
The prototype and example files include support for adding debugging information to the content.? The implementation displays an alert box when the content is closed, though this can easily be modified to force the display of information at any time.?
Enabling Debug
To enable debugging in the prototype or any of the example files, edit the HTM file that is created using the ?Flash with Adobe Connect Tracking? HTML Template provided with this package.? Find the line:
var debug_bln = false;
and change it to read:
var debug_bln = true;
Appending Debug Information
Once enabled, the debug log writes to a variable debug_str which is what is displayed when the browser window is closed.? However, rather than access the variable directly, developers should use a method called addToDebug, with a single String parameter containing the debug code that should be displayed.
|
Method |
Parameters |
Description |
|
addToDebug |
String (Value to add to Debug String) |
Appends the value to the debug string and is displayed when the content browser is closed (assuming debug_bln is true). Returns: Nothing |
For example, if you queried Connect Pro for the learner?s name and wanted to ensure the variable was updated properly.? The following code will add a line to display in the debug message with ?myStudentName_str = {STUDENT_NAME_VALUE}?:
var myStudentName_str = getStudentName();
addToDebug("myStudentName_str = " + myStudentName_str);
Sample Files
There are several example files provided in this document.? They all use the prototype to communicate data with Connect Pro.? This section provides a brief description of each of the sample files.
SinglePage_Sample1
This single page sample is what is created when you review the Walkthrough.? It creates a simple single-page HTM file with a single button.? When the button is clicked, it executes some tracking code to Connect Pro and then attempts to close the browser window.
All of the code used in this example is found in the ?index.htm? file in the root of the sample folder.
SinglePage_Sample2
This single page sample provides a table with data that is retrieved from Connect Pro and then allows you to send data to Connect Pro.? The fields that display the data from Connect Pro are automatically updated when launched.? The fields that are used to send data to Connect Pro are posted when the ?Send Data to LMS? button is clicked.? Optionally, the ?Exit and Close? is used to issue the ?ExitAU? method for AICC and attempt to close the browser window.
All of the code used in this example is found in the ?index.htm? file in the root of the sample folder.
MultiPage_Sample1
This is a multi-page sample which displays three HTM files in a content frame of a frameset.? The navigation frame displays three buttons, Next, Previous and Exit.? The content is set to ?completed? (and a score of 100) when the learner reaches the last page, regardless of whether they have viewed any/all of the other pages (though the pages are displayed linearly).
The file ?index.htm? found in the root of the sample folder provides the frameset.? It displays a Flash-based loading bar until either the data is retrieved from Connect Pro; or there is no valid communication with Connect Pro.? The bulk of the code is found in the ?navigation.htm? file in the Content folder, though some is also referenced from the root ?index.htm? file.
MultiPage_Sample2_withFlashInteraction
This is a multi-page sample which displays three HTM files in a content frame of a frameset.? One of the content pages (page 2) displays a Flash-based interaction.? The navigation frame displays three buttons, Next, Previous and Exit.?
The content is set to ?passed? when the learner views all of the content pages; AND successfully answers the question in page 2.? The content is set to ?failed? when the learner views all of the content pages; AND does not successfully answer the question in page 2.? Otherwise the content is ?incomplete?.
The Flash-based interaction receives a parameter that indicates how the learner answered the question in previous attempts.? Upon answering the interaction, the interaction data is sent to Connect Pro using the sendInteractionData method.? The status and score of the interaction is also sent to the navigation code for determining the score and status of the course, overall.?
Note:? The mechanism to determine whether the learner answered the interaction properly, in this example, is based on when the learner clicks a ?Next?, ?Previous? or ?Exit? button.? This means that it?s possible the learner could answer a question and close the browser and not necessarily receive credit for answering the question.
The file ?index.htm? found in the root of the sample folder provides the frameset.? It displays a Flash-based loading bar until either the data is retrieved from Connect Pro; or there is no valid communication with Connect Pro.? The bulk of the code is found in t
<< Back to Tutorials main menu. ?>




Member Comments
Share your thoughts. Tell us what you think about this tutorial.
dhwalker
FEBRUARY 25, 2009
Andrew,First let me thank you for posting this info. Been looking for something like this for a long time.
Now a question.
After uploading one of the samples to the Connect server and answering the quiz questions it appears that some of the data the Connect server expects is not being passed.
When I run the course reports "By Question" there is a column for "#" where we would normally see a sequence of numbers, "1" for the first question, "2" for the second and so forth. All I get is a "-2".
Also the "Question" column should show the question text but displays no data at all.
Any way to resolve these issues?
DW
AChemey
FEBRUARY 27, 2009
This will be a multi-part response.I downloaded the Sample 3 (named "FlashToConnect_Sample3.zip") from the samples section in this article. I uploaded that file into Adobe Connect into the Content tab and then created a Training Course using that content.
When I launched the content (from Training) I clicked Next until I reached the page to change the Score to 28 and then Next to the question page, where I answered it correctly and Next to "Page 5" where I quit.
AChemey
FEBRUARY 27, 2009
In the reports, Connect indicated I was "In Progress" with a score of 28. The "By Questions" tab showed me the data that I have seen with all other third-party (Non-Captvate and Presenter) AICC-based content. It indicated 1 learner answered the question correctly.AChemey
FEBRUARY 27, 2009
I have seen that the "Question" column is completely blank for all third-party content. At best it would only display the "Interaction ID" from the AICC putInteraction command.AChemey
FEBRUARY 27, 2009
If you are looking for text for the stem of the question such as "What is 1 + 1?" or the distractors (such as 1, 2, 3, 4)... That is something that is not supported by the LMS standards.AChemey
FEBRUARY 27, 2009
Adobe Captivate and Presenter use the files "breeze-manifest.xml" and "trackdta.xml" at upload to pass that data to Adobe Connect. The process is always subject to change.Does this help?
parrotworks
MARCH 02, 2009
Can I use _root variables within my Flash content.swf file? If not, can you recommend a methodology. Thanks.alistairlee
MARCH 02, 2009
Parrotworks - you need to use relative paths (as opposed to absolute) in any SWF you bring into Connect Pro. Remember that Connect Pro is itself a massive flash app running in the player.Use this_parent instead of _root.
pheald
MARCH 30, 2009
I'm trying to use this with the TEDS LMS and am having some issues. Everything seems set up ok, and I can trace out the SID and aicc_url from the javasrcipt, but the LMS fails to initialize in Flash, and it gives up after 16 secs and loads the content with no info from the LMS. Other AICC content works in the LMS, so I'm pretty sure it's a problem on the content end. I'm trying to debug but tracking.swf and Tracking Component are pretty much black boxes. Can you offer any suggestions on what to check for?Many Thanks!
Pete
AChemey
APRIL 03, 2009
Pete,Can you contact me off-list and I'll work with you to try and resolve your TEDS issue(s).
AChemey AT Adobe DOT com
Regards,
Andrew
repsole
NOVEMBER 04, 2009
Hello fellow developers,I have been assigned the task of creating an online certificate for my employer. My main problems is that once the user passed the quiz, a certificate needs to be accessible to print at any time(ie. in a week) with there name, course title and date of completion. any advice would be returned with grateful appreciation.
Michel
AChemey
DECEMBER 02, 2009
Michel - I've already worked with you, but for the benefit of everyone else. The articles that I have currently published are meant for certificates or tracking as content. If you want a "Certificate for Curriculums", contact me directly for a Flash-based file that you can insert as content in a Curriculum for generating a certificate for Adobe Connect Pro, with the "Certificate ID" and data from Connect using the XML-API's.I'll be documenting that in my spare time. :)
ekimrellim
AUGUST 12, 2010
After publishing to my curriculum, the first time I run my course it retrieves the user name etc. successfully and updates the LMS per my requirements upon closing the window. However, when I return to the course, the user name etc. are undefined. If I override the user record results, when I run again the user name etc. have been parsed successfully. Then returning to the course again the same undefined values display.AChemey
AUGUST 18, 2010
ekimrellim,It seems to work fine for me. I'll work with you off-list to help determine the issue.
-Andrew
nitinvartak
NOVEMBER 17, 2010
Hi AndrewIs it possible to get ActionScript 3 version of this SWF that will work with Connect 8?
AChemey
NOVEMBER 26, 2010
nitinvartak - yes it's possible... :)nitinvartak
DECEMBER 17, 2010
Hushhh :-) Can you please post them here?AChemey
DECEMBER 21, 2010
@nitinvartak,Can you contact me off-list.
Regards,
Andrew
ma_maracas
JANUARY 26, 2011
Hi,I am trying to save assessment data back to the LMS.
As far as I can see, populating fileInteractions_ary will do just that, but i can't work out the format to send the data back in? Any ideas anyone?
I know putinteractions accept the following:
"course_id","student_id","date","time","interaction_id","objective_id","type_interaction","correct_response","student_response","result","weighting","latency"
but I don't think this seems correct:
fileInteractions_ary[1] = ["0",lmsStudentID_str,"26/01/2011","15:31:22","Mab Test Quiz","This is question 1","choice","B","B","C","10","00:04.06"];
Any advise would be much appreciated.
Thanks,
Mark
ma_maracas
JANUARY 26, 2011
HI,Just to let people know that Andrew has sorted my question (star).
sendInteractionData(interaction id, objective id, interaction type, correct response, student response, result, weight, latency, date, time)
or
sendInteractionData(“Q1”, “0”, “choice”, “A”, “B”, “wrong”, “1”, “200”, “”, “”);
detail here: http://www.connectusers.com/tutorials/2009/01/flash_connect_pro/
Thanks,