Setting up a calculation icon

Use calculation icons to execute expressions and scripts that change values in variables or that perform calculations in a piece. Insert calculation icons at any point on the flowline or attach them to other icons.

To create an expression for a calculation icon, double-click the icon to open the Calculation window. In addition to using Authorware Script Language to enter variables, functions, expressions, code snippets, and scripts in the window, you have the option of entering JavaScript code. See Using Variables, Functions, Xtra Extensions, and More. For information about using JavaScript in the Calculation window, see Using JavaScript in Authorware.

Authorware usually executes all the statements in a calculation icon and then exits the icon. You can force Authorware to exit calculation icons by entering an Exit statement in an expression. If the calculation icon is attached to another icon, that icon is executed normally.

In most cases, it's a matter of preference whether to place a calculation icon before another icon or whether to attach it. However, if you attach a calculation to a decision or interaction icon, Authorware executes the calculation repeatedly if the icon uses Try Again branching. If the calculation icon is placed before a decision or interaction icon, Authorware executes it only once.

While Authorware executes a calculation icon, no other processing takes place and Authorware doesn't respond to mouse clicks or key presses. For calculation icons that contain relatively simple calculations, this delay is imperceptible. However, calculation icons that contain complex repeat loops take longer to execute and can cause a noticeable delay.

You can set additional properties for the calculation icon in the Property inspector.

See also


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/authorware/7/using_aw_en/02_get27.htm