Widgets use XML to pass data from Animate to Captivate. The following examples illustrate widgets called by Adobe Captivate.

Example 1: Creating objects inside ActionScript

var _parameters: Object = new Object(); 
_parameters.country = txtCountry.text; 
return _parameters;

This code segment creates an object named _parameters and assigns the field country to it. When the _parameters object returns, Adobe Captivate stores it in XML format for future use (for example, for publishing in a certain language).

Example 2: Playing a movie containing a widget

if(movieHandle.widgetParams != undefined && movieHandle.widgetParams != '')//at runtime inside Captivate movie 
trace("widgetParams = "+movieHandle.widgetParams); 
var x:XML = new XML(movieHandle.widgetParams); 
var countryName = x.firstChild.firstChild.firstChild.firstChild.nodeValue; 
initDone = true; 

The visibility state is undefined for widgets. You set this state using the movieHandle.widgetParams property, which contains values derived from Adobe Captivate.

The trace command prints widgetParams, which is a string in XML format. You can access the nodes of the string using XML. Read the code to understand how your data is stored so that you can reach the node you need. To parse the string, use XML that is an ActionScript construct. For more information, see the ActionScript documentation in Animate CC.