Progress Bar "Feature" (A4W Version)

[Previous Page...]

In the Authorware 4.1 version of the Progress Bar example there is a "feature" that causes the page-tracking progress bar (the green progress bar) to draw incorrectly. This undesired functionality can be demonstrated by running the example file, then progressing through the navigation structure using the Next Page button until you reach page 6 or greater in one of the longer sections. While the navigation is displaying page 6 or greater, click the Section Back or Section Forward buttons until you reach a section that has only 5 pages (fewer pages than the current page you are viewing). In this case, the green "Page" progress bar is drawn beyond it's frame -- and even beyond the presentation window in some cases (see the illustration below).


Illustration 1: Yecchy progress bar functionality stinking up my application

A few lines of code are all it takes to trap this "error" and display relatively proper pages as the user navigates forward or backward using the Section navigation buttons. In the case of my solution, I elected to "store" the current page in a new variable each time the user navigates forward or backward using the Page navigation buttons. I did this by placing the following code segment at the very bottom of the script contained in the calc icons attached to the Page Forward and Page Backward buttons:

numPageValue := listNavPointer[2]

When the user clicks either the Section Forward or Section Backward buttons, the following snippet of code checks to make sure that the page pointer variable does not contain a value that is higher than the number of pages contained in the "new" section:

if numPageValue > listSectionsStructure[listNavPointer[1],2] then
  listNavPointer[2] := listSectionsStructure[listNavPointer[1],2]
else
  listNavPointer[2] := numPageValue
end if

Notice that in this solution, when the user navigates to a section containing fewer pages than their "current" section the last page of the new section is displayed. But as the user continues to navigate forward and/or backward through the sections, when they arrive at a section that contains a number of pages equal to or greater than their current page, the page equal to their current page is displayed. For example, if a user is on page 7 of a section and they navigate backward (using the Section Backward button) to a section that contains only 5 pages, page 5 of that section is displayed. If they continue to navigate backward using the Section Navigation button to a section that contains 10 pages, the 7th page of that new section is displayed. Neat, huh?


[Previous Page...]



Please send your questions, comments, or suggestions to Mike Bray., Huntington Beach, California