Copy link to clipboard
Copied
Had a recent situation where our client wanted to update content in a Captivate module, republish, and promote to the production server. During testing, I noted that the updated .swf, wasn't inheriting the Shared Object data from a prior session with the previous content version.
Further testing with a new/bare-bones file was inconclusive concerning Shared Object inheritance.
So the question is this... can/will a revised version of a Captivate project inherit the Shared Object data from a previous version of itself given the same exact name, file location, etc? Doesn't appear to be so, I there doesn't appear to be the capability to retrieve the data like I can in Flash/Flash Builder with AS3.
In our case, it was the EXACT same file. There were just some minor text edits.
Copy link to clipboard
Copied
It should, especially under your circumstances. Can you look at the SO and see if it's being updated? I think modern browsers are starting to not like SO's.
You might want to change to localStorage.
Copy link to clipboard
Copied
What's the difference between a SO and localStorage?
Copy link to clipboard
Copied
SO stands for Shared Object. It's Flash Player's version of a cookie.
Local Storage is what browsers now use as a way for HTML5 content to store some data that can then be retrieved in another session, i.e. just like cookies, but with more scope.
Copy link to clipboard
Copied
Thanks. I am quite familiar with SO, but hadn't done much work with localStorage yet.
Copy link to clipboard
Copied
localStorage is stored in a database as key/value pairs. You can generally store up to 10MB of string data. You can store your data to persist until the user clears the storage or you can use sessionStorage which is cleared at the end of the browser session.
Also data can be shared per domain, there are cross domain scripts also. Data can also be stored per specific course/site use.
Everything you can do to get away from anything Flash related will help you in the long run.
You can see and clear the local storage in your browser developer tools, by typing localStorage in the console.
This article explains it very well.
Copy link to clipboard
Copied
Are there any native provisions/scripts/capabilities within Captivate to work with localStorage?
Copy link to clipboard
Copied
Not really. I just put the scripts in a js file. I use it to keep progress in HTML5 courses. I set it up so that when the onEnter event listener is fired it checks the local storage and writes progress if it is greater than what is currently stored.
In Captivate you could call storeLocal(argument) and then in the js function parse and store the argument.
The only caution is to preface with some dot syntax such as:
courseID.somevariable = sentValue
This keeps the stored string separate from other uses on the same domain.
This example script checks if the browser supports localStorage and is used to keep track of a users volume setting between session and modules of a course. If the user turns their volume down it always remains at that setting until they change it again. The functions are triggered from the volume control. It also parses the Module number from the URL string for other purposes.
//These functions are used to store the students audio settings in order for the popups to reflect their settings
var courseID = "LOG_117.";
var folder = getFolder( document.location.href );
var dataFolder = JSON.stringify( courseID + "." + folder + "." );
function getFolder(url)
{
var arr = url.split('/');
return arr[arr.length - 2];
}
function getConnected()
{
if ( window.location.href.indexOf("http") == 0 )
{
return true;
}
else
{
return false;
}
}
function supports_html5_storage()
{
if ( typeof(Storage) !== "undefined" )
{
return true;
}
else
{
return false;
}
}
function getVolume()
{
var thisVol = courseID+"myVolume";
if ( supports_html5_storage() )
{
if ( localStorage.getItem(thisVol) == null || localStorage.getItem(thisVol) == 'undefined' )
{
localStorage.setItem(thisVol, 60);
return 60;
}
else
{
return parseInt( localStorage.getItem(thisVol) );
}
}
else
{
alert("Your browser does not support local storage, your volume setting cannot be saved for this module.")
}
}
//function called from the main file when user changes volume settings
function setVolume( vol )
{
if ( supports_html5_storage() )
{
localStorage[courseID+"myVolume"] = vol;
}
}