Creating a variable

To create a variable, you need to create a name for it, and then define it. You can start the process of creating a custom variable in several places:

To create a variable in the Variables dialog box:

  1. Select Window > Variables.
  2. Click New.
  3. Type the name you want to use for the variable in the Name field.
  4. In the Initial Value field, type the value you want Authorware to assign to the variable at the outset when someone runs the piece you're creating.

    If you don't enter a value, Authorware uses 0.

  5. Type a description.

    Provide as much information as possible about the variable and how you're using it. This will help you remember your purpose for creating the variable.

  6. Click OK to close the dialog box.

Authorware keeps track of the value of the variable automatically and adds it to the list of variables in the Variables dialog box. It stays in the category with the same name as your Authorware file. You will not see it in the All category.

To create a variable in a Calculation window:

  1. Type the name of the new variable in the expression where you want to use it, and press the numeric keypad Enter key.
  2. In the Initial Value field, type the value you want Authorware to assign to the variable at the outset when someone runs the piece you're creating.

    If you don't enter a value, Authorware uses 0.

  3. Type a description.

    Provide as much information as possible about the variable and how you're using it. This will prove important in helping you to remember your purpose for creating the variable.

  4. Click OK to close the dialog box.

Authorware keeps track of the value of the variable automatically and adds it to the list of variables in the Variables dialog box. It stays in the category with the same name as your Authorware file. You will not see it in the All category.

To create a variable in a field in a dialog box:

  1. Type the name of the new variable in the field where you want to use it, and click OK.

    If you want to use the variable in an expression in the field, type the name as part of the expression.

  2. In the Initial Value field, type the value you want Authorware to assign to the variable at the outset when someone runs the piece you're creating.

    If you don't enter a value, Authorware uses 0.

  3. Type a description.

    Provide as much information as possible about the variable and how you're using it. This will help you remember your purpose for creating the variable.

  4. Click OK to close the dialog box.

Authorware keeps track of the value of the variable automatically and adds it to the list of variables in the Variables dialog box. It stays in the category with the same name as your Authorware file. You will not see it in the All category.

To create a variable in a text object:

  1. Open the display icon or the interaction icon you want to use to display the variable, and select the text tool.
  2. Click the cursor at the spot where you want the contents of the variable to appear. Then type a left brace ({), the name of the new variable, and a right brace (}).

    For example, to create a new variable named Counter, type:

    {Counter}
    
  3. Close the Presentation window.
  4. In the Initial Value field, type the value you want Authorware to assign to the variable at the outset when someone runs the piece you're creating.

    If you don't enter a value, Authorware uses 0.

  5. Type a description.

    Provide as much information as possible about the variable and how you're using it. This will help you remember your purpose for creating the variable.

  6. Click OK to close the dialog box.

Authorware keeps track of the value of the variable automatically and adds it to the list of variables in the Variables dialog box. It stays in the category with the same name as your Authorware file. You will not see it in the All category.


 

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_var21.htm