Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slideshow with "next" and "previous" buttons

Status
Not open for further replies.

Mikey13b

Technical User
Feb 23, 2006
2
AU
Hi there, I just need to make a basic slideshow of photos, but instead of scrolling through them automatically, i need to use buttons to go to the next image, and so on.

Can anyone please provide me with an example of the scripting i would need to apply to the buttons. I know its pretty simple but im getting it wrong somewhere and could really use your help!
There are a lot of photos, so im guessing the scripting will have to refer to the current cast member +1 in order to move through the lot, but im just not sure how to apply this...

Thanks,
Mike
 
This will swap the picture in sprite(1) to the next one in the cast.

[tt]-- behaviour attached to a button
on mouseUp me
sprite(1).memberNum = sprite(1).memberNum + 1
end mouseUp
--[/tt]

Kenneth Kawamoto
 
You might want to add a little bit of code to avoid and error when you go to click next on your last photo. Something like:

-- X = your max number

if sprite(1).memberNum > X then
sprite(1).memberNum = 1

--or instead of a number, a preset property with your spritenumber in.
 
Thanks guys! That was a great help and it worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top