Accessibility
 
Home > Products > Authorware > Support > Basics
Macromedia Authorware Support Center - Basics
Modular logic and list variables

Modular logic can be very simple or can become difficult to follow.One of the simplest examples is a menu structure where system buttons are used to navigate to a section or subsection.Each portion must be completed by the student before the next button is enabled, and once the section is completed a checkmark appears on the system button.System buttons do not have a separate checked state, so one possible workaround is to graphically create a fake system button with three states.This is not really very portable, since you would have to create a button for every menu item that appeared on every menu in your piece, not to mention the problem of needing to change a menu item title.

A more efficient solution is to create a set of check marks created with Authorware's drawing tools in uniquely titled display icons.

If each display icon has an attached calculation with logic like this:

counter := counter +1
SetAtIndex(Checkmarks, IconTitle, counter)

then you wind up with a list like this in Checkmarks:

["Check 1@SCI 1000", "Check 2@SCI 1000", "Check 3@SCI 1000"]

This enables you to display or not display the icons with the listed titles based on whether or not the student has completed the sections.

The menu itself falls below the checks on the flowline.

If each section is represented by a check mark, then there could also be a list of completion data for each section.As each section is completed, its element in the list Sections_Completed is set to 1.This list can be used both to enable the next button and to display the check marks.

The checkmarks are displayed by first hiding all of the checks, then comparing the list Sections_Completed to Checkmarks and displaying the checks that correspond to the sections completed.The way that both of these functions are accomplished is through a repeat loop.The calculation attached to the interaction icon is an ideal place to put this because at some point it may be necessary to include a hot spot so that users in the know can enable this menu without completing the sections.If the logic to show the checks is in this location, the checks appear when the menu is enabled, rather than the next time a user enters the section.

Here is the script in the attached calculation:

repeat with X in Checkmarks
 LayerDisplay (-1, IconID@X)
end repeat
counter := 0
repeat with X in Checkmarks
 counter := counter + 1
 if ValueAtIndex(Sections_Completed, counter) <> 0 then
  LayerDisplay (2, IconID@X)
 end if
end repeat

This entire construct can be copied and pasted anywhere.The only thing that has to be changed is the name of the list Sections_Completed in every case where it occurs, including the Active If field of each menu button.That can be a bit of a hassle, so to further streamline the process, a calculation icon can be added to the flowline just above the interaction icon that copyies Sections_Completed into another list using the CopyList function.The name of that list is substituted in every location where Sections_Completed appears in the above example.At that point the only place the name of the list will need to be changed to tailor this logic is in that calculation.

To Table of Contents Back to Previous document Forward to next document