Captivate Action Extensions

This page explains how to use command variables that extend Captivate actions.

Captivate already allows you to hide/show objects, enable/disable interactive objects and change what state an object is displaying. However, it only allows you to do so on one object at a time. If you wanted to hide ten objects, you'd have to set up ten hide actions, which is extremely time consuming.

CpExtra therefore adds command variables that perform the same actions that Captivate already does, but allows you to perform them on multiple objects much easier.

xcmndHide

​Features

  • Uses @syntax
  • Uses comma delimited lists

Description

Assigning xcmndHide with the name of a slide object will cause that slide object to be hidden.

The code below will hide any object called Caption_1 (even if that object is not on the current slide).

Assign | xcmndHide with Caption_1

You can give xcmndHide a list of objects to hide by separating their names with commas.

The code below will hide Caption_1, Caption_2, and Caption_3, through a single assign action.

Assign | xcmndHide with Caption_1, Caption_2, Caption_3

You can use an @syntax query to select a group of objects to hide.

If you have four objects on slide called: Caption_1, Caption_2Caption_Bob, and Shape_1; the following code will hide Caption_1, Caption_2, and Caption_Bob but NOT Shape_1.

Assign | xcmndHide with Caption_@

You can also use a mixture of @sytax and comma delimited lists. Using the slide example above, the following code would hide all four objects, including Shape_1

Assign | xcmndHide with Caption_@, Shape_1

Note: @syntax will only select matching objects on the current slide. It will not hide all matching objects throughout the project.

xcmndShow

​Features

  • Uses @syntax
  • Uses comma delimited lists

Description

Assigning xcmndShow with the name of a slide object will cause that slide object to be shown.

It's usage is exactly the same as xcmndHide.

xcmndDisable

​Features

  • Uses @syntax
  • Uses comma delimited lists

Description

Assigning xcmndDisable with the name of an interactive object will cause that object to refuse user input.

  • Buttons, Click Boxes, and Shape Buttons will ignore any clicks on them.
  • Text Entry Boxes will not allow the user to write text into them.

The code below will disable any object called Button_1 (even if that object is not on the current slide).

Assign | xcmndDisable with Button_1

You can give xcmndDisable a list of objects to hide by separating their names with commas.

The code below will disable Button_1, Button_2, and Button_3, through a single assign action.

Assign | xcmndDisable with Button_1, Button_2, Button_3

You can use an @syntax query to select a group of objects to hide.

If you have four objects on slide called: Button_1, Button_2, and Button_Bob,, and Text_Entry_Box_1; the following code will hide Button_1, Button_2, and Button_Bob, but NOT Text_Entry_Box_1.

Assign | xcmndDisable with Button_@

You can also use a mixture of @sytax and comma delimited lists. Using the slide example above, the following code would disable all four interactive objects, including Text_Entry_Box_1

Assign | xcmndDisable with Button_@, Text_Entry_Box_1

Note: @syntax will only select matching objects on the current slide. It will not hide all matching objects throughout the project.

xcmndEnable

​Features

  • Uses @syntax
  • Uses comma delimited lists

Description

Assigning xcmndEnable with the name of an interactive object will cause that object to accept user input.

It's usage is exactly the same as xcmndDisable.

xcmndChangeState​

Parameters

  1. Slide object name (or @syntax query).
  2. State name

​Features

Description

xcmndChangeState must be assigned with two parameters. Giving it more or less parameters will cause an error. The parameters  are as follows:

  1. The name of a slide object OR an @syntax query.
  2. The name of a state that object has.

Say you have a shape called Shape_1 on stage. By default, all shapes come with a state called Normal. You add another state to the shape, perhaps changing the color of the shape. You give that new state the name of MyNewState. The code below will make Shape_1 display its MyNewState state.

Assign | xcmndChangeState with Shape_1, MyNewState

​The first parameter can use @syntax to select a group of objects to display a certain state.

If you had a slide with objects named Shape_1, Shape_2, Shape_Bob, and Caption_1, the following code would make Shape_1, Shape_2 and Shape_Bob display their MyNewState state.

Assign | xcmndChangeState with Shape_@, MyNewState

The developer should ensure that Shape_1, Shape_2 and Shape_Bob all have a state named MyNewState, otherwise errors might occur.

IF YOU LIKE WHAT YOU'VE READ ABOVE, THERE'S PLENTY MORE!

Join more than 2500 other Adobe Captivate users just like yourself and receive regular troubleshooting tips, illustrated tutorials, technical information, and creative solutions to real-world e-learning development issues. (See an example here.) Click the button below to join our community.  It's completely FREE!