Accessibility
 
Home > Products > Authorware > Support > Basics
Macromedia Authorware Support Center - Basics
Page titles as variable drivers

The Overview mentions that the page title can be used to drive the change of common elements between pages. This concept can be used in several ways, including searching an external file for the page number and loading the data into the variables from that. See the Authorware Help Pages for more information about external content and displaying variables on screen. The disadvantage is that it's possible for a prankster with a text editor could change course content or render a file inoperable.

The technique I prefer is to gather all the information for the frames in a section into a central location and load the information for a particular frame. One reason for consolidating all the information is that storyboards can be turned into frames by typing the information in one place.

This leaves the problem of how to navigate from the individual map icon to this central location and back to display the updated page. You may recall this from the overview:

frame_name := IconTitle(CurrentPageID)
frame_number := SubStr(frame_name,5,8)

with 5 being the first numerical character in the numerical portion of the map name and 8 being the last one.

If a calculationicon containing this script is the first icon within each page map icon, every time a user navigates to a different frame, the frame name and number will change. A perpetual conditional interaction ( frame_number_old <> frame_number ) in the framework can capture this change. The branching on the Calculation Icon should be set for Return. The Next and Previous buttons should be placed at the lowest level framework at which return branching occurs or they will not navigate properly. Be aware that the only automatic setting on perpetual conditionals set to return is On False to True, so set frame_number_old to frame_number initially.

The first calculation empties all variables in the frame of their previous values. The next two contain scripts that list every possibility for pages in this course.

graphic_path := FileLocation ^"Intro\\" 
--Begin frame 0000 
If frame_number = 0000 then
 body_text := "Welcome to the"^Course_name^"Course. This 
course is important to your life because it just is."
 --that's right, if you name your graphics right you only have to code this 
once, too! 
 screen_graphic := SubStr(frame_name, 1, 8)^".*" 
 screen_graphic2 := SubStr(frame_name, 1, 8)^"a.*" 
 popup_graphic1:= SubStr(frame_name, 1, 8)^"b.*" 
 popup_graphic2 := SubStr(frame_name, 1, 8)^"c.*" 
 popup_graphic3 := "" 
 popup_graphic4 := "" 
 popup_graphics := [popup_graphic1, popup_graphic2, popup_graphic3, popup_graphic4] 

 popup_text1 := "This pops up if you click object 1." 
 popup_text2 := "This pops up if you click object 2." 
 popup_text3 := "" 
 popup_text4 := "" 
 All_popup_text := [popup_text1, popup_text2, popup_text3, popup_text4] 
 prompt1 := "Click object 1 to continue." 
 prompt2 := "Click object 2 to learn more about it." 
 prompt3 := "" 
 prompt4 := "" 
 prompt5 := "Click right arrow to continue." 
 All_prompts := [prompt1, prompt2, prompt3, prompt4, prompt5]

end if 
-- end 0000
--Then copy the template from 0000 and plug in the values
--Begin frame 0010 
If frame_name = 0010 then
 body_text := "Today you will be learning about whatchamacallits." 
 screen_graphic := SubStr(frame_name, 1, 8)^".*" 
 screen_graphic2 := "" --SubStr(frame_name, 1, 8)^"a.*" --This could also be 
left in place. If no graphic with that name exists, it will not appear. 
 popup_graphic1:= "" --SubStr(frame_name, 1, 8)^"b.*" 
 popup_graphic2 := "" -SubStr(frame_name, 1, 8)^"c.*" 
 popup_graphic3 := "" 
 popup_graphic4 := "" 
 popup_graphics := [popup_graphic1, popup_graphic2, popup_graphic3, popup_graphic4] 

 popup_text1 := "" 
 popup_text2 := "" 
 popup_text3 := "" 
 popup_text4 := "" 
 All_popup_text := [popup_text1, popup_text2, popup_text3, popup_text4] 
 prompt1 := "" 
 prompt2 := "" 
 prompt3 := "" 
 prompt4 := "" 
 prompt5 := "Click right arrow to continue." 
 All_prompts := [prompt1, prompt2, prompt3, prompt4, prompt5] 
end if --end 0010
The old frame number should be set to the current frame number so that the conditional interaction can react when it changes again. The return branching returns right back to the point in the frame after the frame number changed. The body text has been set above, and the main screen graphic is set by concatenating graphic_path^ screen_graphic . If this graphic changes as a result of an interaction, you simply replace screen_graphic with screen_graphic2 .

An interaction in frame 0000 might look like this:

The result icons on the hot spots then make use of the fact that the text and graphics are placed in lists in an orderly fashion.

leg := IconTitle feedback := ValueAtIndex(popup_text, leg) popgraphic_path := Graphic_path ^ValueAtIndex(popup_graphics, leg) prompt := ValueAtIndex(prompts, leg+1)
The interaction will work in any frame that is been loaded as described above.

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