Where you can use variables, functions, expressions, code snippets, and scripts

In a calculation icon Opening a calculation icon displays a Calculation window. Calculation windows can contain variables, functions, expressions, code snippets, and scripts. For example, you might put a calculation icon at the very beginning of a file and use it to set the value of a variable that controls how long wait icons pause throughout the file.



In a Calculation window attached to an icon You can also use variables, functions, expressions, code snippets, and scripts in Calculation windows attached directly to icons.

You attach a Calculation window directly to an icon to make sure Authorware executes the calculation whenever it encounters the icon. For example, you've created a target area interaction and you want to make sure that the objects users are supposed to move are tagged as movable at the moment they enter the interaction. The best way to accomplish this is to attach a Calculation window to the interaction icon (Modify > Icon > Calculation) and set it up as shown in the following figure:



When you attach a Calculation window to an icon, a small equal sign (=) appears slightly above and to the left of the icon.

In the Property inspector You can use variables, functions, and expressions--but not scripts--in most editable fields in the Property inspector. For example, you might want to position an object at the last spot where the user clicked. To do that, use the ClickX and ClickY variables in the Position fields of the Property inspector, as shown in the following figure:



In a few editable fields, you can't use a variable, function, or expression: fields where you name things (such as icons, text styles, or keywords) or where you provide descriptions (such as the description of a button state in the Button Editor). There are also other fields where only literal values can be used, such as the scale and size fields of image properties.

Embedded in display text You can display the contents of a variable or the value of an expression on the screen by embedding it in a text object or an RTF document. Embedding the content of a variable in text objects makes it possible to display information that changes from moment to moment or from user to user. Embedding an expression in a text object makes it possible to display the result of a calculation without having to add a calculation icon to the flowline. A text object with embedded variables and expressions looks like this:



When Authorware displays the text object, it displays the value of the variable or expression, not the variable or expression itself.




 

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/09_varf3.htm