View Full Version : EXAMPLE: Slideshow Project
Desmond
10-04-2005, 03:54 PM
Hello,
This project is a variation on another example (http://www.indigorose.com/forums/showthread.php?t=13197 ), and allows you to load all image files from a specific directory and show them, one after another, as a slideshow.
Skills Used: Fade Images, Global Functions, Timer, Image Object, Opacity, For Loops.
FoxLeader
11-04-2006, 08:06 PM
Hi,
I want to add a few buttons:
Next picture
Back (a picture before)
Faster (buttons, not with the plugin)
Slower (buttons, not with the plugin)
Is it possible ? How?
If yes, can you show me commented code?
Thanks a lot for your help!
FoxLeader
SiNisTer
03-30-2007, 06:26 AM
Hi,
I want to add a few buttons:
Next picture
Back (a picture before)
Faster (buttons, not with the plugin)
Slower (buttons, not with the plugin)
Is it possible ? How?
If yes, can you show me commented code?
Thanks a lot for your help!
FoxLeader
:rolleyes i was wonderin bout the same thing cos its gona make the project a lil more interactive...
n nice coding there
Desmond
03-30-2007, 09:25 AM
Those are some great ideas! Once you have a working project exactly as you'd like it, please feel free to post back to this thread. Here's some concepts that'll hopefully get you started. I've just copied / pasted code from various events around the project here -- with a few tweaks, you should be able to do what you need.
Forward Button
Re-use the code on the page's 'On Timer' event ... and remember to reset the timer counter!
-- Get the current number of items in the array
nItems = Table.Count(tImageArray);
-- If the displayed picture is the last picture, reset the count, otherwise incriment it.
if nCurrentItem == nItems then
nCurrentItem = 1;
else
nCurrentItem = nCurrentItem + 1;
end
-- Open the image
OpenImage(tImageArray[nCurrentItem]);
-- Reset the timer
nCurrentSecond = 0;
Back Button
This is the same concept as above, except you have to reverse the logic in the image selection statements
-- If the displayed picture is the last picture, reset the count, otherwise incriment it.
if nCurrentItem == 1 then
nCurrentItem = nItems;
else
nCurrentItem = nCurrentItem - 1;
end
Faster / Slower buttons
For this, you'd have to enter code on the On Click event of the button to increase / decrease speed by some interval.
-- Set the seconds per picture based on the previous value
nSecondsPerPicture = nSecondsPerPicture + 1;
Note: The above code has not been tested.
FoxLeader
04-05-2007, 05:03 PM
Thanks! I'll take a look a it ;)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.