Use javascript to read contents of CSV file
Copy link to clipboard
Copied
Can I use the JQuery code below in CP 6 and 7 to read the contents of a CSV file?
http://jquery-csv.googlecode.com/git/examples/basic-usage.html
Then, I would like to use the tutorial below to assign an array value to one of my user variables.
http://captivatedev.com/2012/07/01/adobe-captivate-6-the-javascript-api/
It seems like it should work. However, is there something I'm overlooking?
Micky
Copy link to clipboard
Copied
You could use that library, but it's not compatible across all browsers and the library is not that mature. If I were going to load any kind of data from a file, I wouldn't choose CSV... I'd go with JSON. Why? Because you can serialize/deserialize most data directly into a JavaScript object. Meaning you don't need to mess with parsing text or iterating over messy arrays... you can store and retrieve JavaScript objects as true JavaScript objects. Take a look at these links for more info:
http://www.copterlabs.com/blog/json-what-it-is-how-it-works-how-to-use-it/
Copy link to clipboard
Copied
Jim, this is very helpful!
Have you ever heard of someone using the external files to identify what images display in the online course? I wonder how far I can take this concept. I wonder if non-captivate users could use the text file to indicate the text that appears in the captions, the character images that display, and even indicate how many levels of branching can be used.
Copy link to clipboard
Copied
Unfortunately for SWF output, Captivate is not as dynamic as we'd hoped it would be. It does not allow dynamic loading of images or swfs based on settings in an external file. However, you can control the text that gets displayed by getting/setting Captivate variables that are displayed in text captions or smart shapes. You can also control branching that's based off of Captivate variables.
Basically anything dynamic that you want to do has to be supported by the JavaScript API. Currently, the only thing you can do through this API is get/set Captivate variables. So you can control branching in a course based on Captivate variables... and also alter the text that gets displayed in a text caption or smart shape.
Just an FYI... you could load external images and swfs in Captivate 6, but Adobe considered this a security risk and patched that hole. Here's a demo of what was possible:
http://captivatedev.com/2013/03/30/dynamically-loading-images-and-swfs-at-runtime-in-adobecaptivate/
It would be so incredibly cool if we could do this in a way that wouldn't compromise security (hint, hint).
HTML5 output is a bit different. The JavaScript API is more extensive and it allows you to tap into slide enter and exit events (and other events). Since the published output is simply HTML, JavaScript, and CSS, it is possible for a developer to tap into the guts and do a lot of customization... but you would need a web developer for this.

