Using Xml In Widgets - Adobe CAPTIVATE 5 Help Manual

Table of Contents

Advertisement

Last updated 4/22/2010
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
object returns, Adobe Captivate stores it in XML format for future use (for example, for publishing in a certain
language).
DRAFT
and assigns the field
_parameters
USING ADOBE CAPTIVATE 5
to it. When the
country
_parameters
124
Widgets

Advertisement

Table of Contents
loading

Table of Contents