|
|
![]() It was once suggested that I incorporate "captions" with an ASP/JavaScript Slide Show Application that I had designed. Although I never had any personal requirement to use captions, the idea seemed like an interesting challenge, because those captions should be dynamic. In other words, just like the images, the captions for each picture should be pulled into the page programmatically. Well, this brought me to look into the FileSystemObject and the following design. |
|
|
For image stock on this experiment, I used pictures from the Auto-Cross that my friends Chuck, Dinah, and I attended in September, 1999. The photos were taken with my Olympus C2000 Zoom. The day was beautiful, and the fun we had was outrageous! |
|
|
In addition to
the image files, there is a text file in that sub-folder called "contents.txt".
This text file has a dual purpose; the first line in the text file is used
as the Slide Show Title (in this case, "Sunday at the
Auto-Cross".) And last, the VBScript used in this Active Server Page. Of course, there is more to the page functionality than just this script. ASP assignments are used for each VCR button, the Refresh metatag, and the window title. As well, there is a combination of JavaScript and ASP used to pre-load the next image in the loop, and a simple "CloseWindow" JavaScript function. But really, the bulk of the logic for this design is in the file naming conventions, the folder configuration, and the following VBScript found in the header of the Active Server Page: |
|
<% DIM strCat, strFolder, strFile, strTitle, strCaption DIM lngInd, lngMax, lngPrev, lngNext, lngCtr DIM objFSO, objText, objFolder, objFiles
strCat = cStr(Request.QueryString("cat")) If (lngPrev < 1) Then
lngPrev = lngMax strTitle = objText.ReadLine For lngCtr = 1 to
lngInd objText.close Set
objFSO = Nothing |
|
|
In retrospect, the easiest part of this little experiment was figuring out the design, and then it was a simply a matter of discovering the objects and syntax necessary to build it. |
Home • Photos • Toys • Misc • Contact |