Make your FrontLook Component Effects slide
shows interactive by allowing the viewer to click on a text or image
hyperlink to jump to a particular slide in the presentation. This month's
tip shows you how to add a simple line of JavaScript to the a text or
image hyperlink to enable your viewer to navigate your presentation. This
functionality is documented on the Component Effects Advanced page of the
Component Effects Help file.
By configuring the JavaScript into single
lines of code that is then placed into the URL field of the hyperlink
properties, we can make simple controls for the FrontLook Component
Effects without learning any formal scripting skills. For this example,
the single line "Go To Slide" function will take the form:
javascript:var temp=MyComponentName.GotoSlide('Index');
where "javascript:"
tells the browser that the following text is for the JavaScript
interpreter, the var temp=" is a
placeholder for the functions return value, the "MyComponentName"
is the name of the component as set in the "Name" field on the
Presenter's Component panel and "index" is the slide number. The "GotoSlide()"
function tells the component to display
the image and its caption at the specified index in the Images list. Valid
range for the index values is from 1 to the number of images in the
component. The component ignores invalid index values and maintains its
state before the call. Also, please note that JavaScript is case
sensitive.
Other Navigation functions:
Several other functions will be used in this example to facilitate
easy user navigation.
javascript:MyComponentName.Begin();
where the Begin() function
displays the first slide.
javascript:MyComponentName.Back();
where the Back() function
displays the previous slide.
javascript:MyComponentName.Next();
where the Next() function
displays the next slide.
The "var temp=" is not
required for the Begin, Back and Next Functions since these functions do
not return anything. See the Component Effects
Advanced page of the Component Effects Help file for other functions.
Setup the Component
For this example, the Presenter component will be setup with complex
captions. The same image/slide will be the same on every page, but the
caption will be different. The caption for the first
slide will allow the user view a set of
eight thumbnails, each JavaScript-hyperlinked to a higher
resolution image of the thumbnail. The
Presenter Component was also chosen so that a full button bar controller
could control the sequencing of the presentation. Please try the demo
below and note the JavaScript URLs in the status bar of your browser.