Specifications

139
USING CAPTIVATE
Widgets
Last updated 9/28/2011
Sample code for defining visibility for different modes
function cpSetValue( variable:String , val )
{
if(variable == 'movieHandle' ) {
movieHandle = val;
mainmov = movieHandle.getMovieProps().variablesHandle;
}
if (variable == 'widgetMode')
{
widgetMode = val;
}
}
this.onEnterFrame = function()
{
var wm:String = widgetMode;//this variable will be provided by Captivate App or Captivate Movie
if(wm == undefined)
{
wm = widgetMode;
}
if(wm == undefined)
wm = 'Stage';
if(wm == 'Edit')//Property inspection inside Captivate app
{
button1.visible=true;
}
else if (wm == 'Preview')
{
button1.visible=false;
}
else //this is the stage mode
{
button1.visible=true;
}
}
Using XML in widgets
Widgets use XML to pass data from Flash to Captivate. The following examples illustrate widgets called by Adobe
Captivate.
Example 1: Creating objects inside Flash 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).