Specifications

138
USING CAPTIVATE
Widgets
Last updated 9/28/2011
The visibility state is undefined for widgets. Use the movieHandle.widgetParams property to set the visibility state.
Use the following tips when making visibility decisions:
Decide whether the widget is visible in the following cases:
Edit area
Property Inspector
During run time
Optimize the code for drawing. Excessive use of this code can slow down the player. The widget dialog box might
not disappear even after the OK button is clicked.
Optimize the code in the OnEnterFrame function for the widget so that CPU use is kept to a minimum.
The drawing code is CPU intensive. Store states inside variables and use them to draw only when required.
To test for Flash-related issues, you can simulate the way the widget appears on stage within Flash without
launching Captivate. Hard-code
wm = 'Stage' and wm = 'Edit' in the OnEnterFrame function. Similarly, to
simulate the behavior of the widget at run time using Flash, hard-code
widgetParam, and then test.
Use the trace command to debug SWF files. Ensure that you delete the command during final testing as it degrades
performance.
Ensure that you publish to the following only:
Flash 8 and later
ActionScript 3.0.
Defining the preview movie
You can provide a dummy SWF file that appears in the preview area when the user selects a widget in the Widget panel.
The dummy SWF file gives users an idea of how the widget works.
Explore the PieChart.fla to get a better understanding of the procedure for defining a preview movie.
1 Open the PieChart FLA file for the pie chart in Flash. This file is available on your computer in the \\Program
files\Adobe\Adobe Captivate <Version number>\Gallery\Widgets folder.
2 In the Property Inspector, select the movie outside the Stage. The name of the movie PieChart_prvw is displayed
in the Property Inspector.
3 Right-click (Windows) or Control-click (Mac OS) the frame containing the action, and select Actions.
4 Locate the following piece of code.
if (wm == 'Preview')
{
PieChart_prvw._visible = true;
}
The code sets the movie to preview mode and displays the movie in the preview area when the user selects the
widget. If you set the visibility to
false, the widget is not displayed in the preview area.