![]() the clicker code snippet | show it | return | |
---------------- o o o o o o o o o o o o o o o o o o --
-- HANDLER showSlide
-- point web browser to appropriate slide and caption
---------------- o o o o o o o o o o o o o o o o o o --
on showSlide slideNumber
-- first check the counter is in the displayable range
-- of 0 <= slideNumber <= gSlideMax
if slideNumber < 0 then
set slideNumber = 0
else if slideNumber > gSlideMax then
set slideNumber = gSlideMax
end if
-- hide buttons if at limits
repeat with i = 7 to 8
set the visible of sprite i = (slideNumber > 0)
end repeat
repeat with i = 9 to 10
set the visible of sprite i = (slideNumber < gSlideMax)
end repeat
-- don't bother if this is the current slide!
if slideNumber <> value(field "counter") then
-- kill any audio playing
if gSoundType = ".swa" then
STOP ( member "caption swa" )
else
puppetSound 0
end if
-- update the counter display
put slideNumber into field "counter"
if slideNumber = 0 then
-- assign screens for the title page
set screenPage = "open" & gFileNameExtension
set captionPage = "caption" & gFileNameExtension
else
-- grab the title for the new slide
set currSlide = getAt(gSlideTray, slideNumber)
-- assign screens for a slide page
set screenPage = "images/" & currSlide & gFileNameExtension
set captionPage = getAt(gCaptionButtons, gCurrentCaption) & "/" ¬
& currSlide & gFileNameExtension
end if
-- update the frame with the slide image
gotoNetPage (screenPage, "screen")
-- update the frame with the current caption
if gShowCaptions then gotoNetPage ( captionPage, "caption")
-- start audio if mode set for autoplay
if gAudioMode = 2 then playCaption
end if
end
|
| Generalized handler for displaying a slide. There are checks to see if the selected slide is within the range available. Any sound playing is stopped, and then the correct filepaths for image and caption HTML files are built.
lingo era = v5 The full script contains many parameters that are read as shockwave paramters, as there are many options for number of caption sets, types of sound files, etc. |