Using a slider and updating an image field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Chibling
Posts: 21
Joined: Thu Jul 16, 2009 9:05 pm

Using a slider and updating an image field

Post by Chibling »

Hello,

I have an image field with 101 images with a slider underneath,
I am currently using the handler "onmouseup" for the slider, this is ok as individual clicks will result in image changes...

However, I would ideally like the images to change on the fly as the clicked mouse moves along the slider (instead of only on mouse up).

Currently, the image only changes on mouse up, not the entire time the slider is being moved.

Thank you,

I am a novice so bear with me,

Another handler or method of getting the slider to update every image as the slider moves is ideally what I am looking for.
malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte »

Hi Chibling,

you are looking for the scrollbarDrag message and the thumbpos property.

Hope that helps,

Malte
Chibling
Posts: 21
Joined: Thu Jul 16, 2009 9:05 pm

Works!

Post by Chibling »

Hello responder,

thank you so much, that is exactly what I needed!
DunedinMultimedia
Posts: 4
Joined: Mon Mar 07, 2011 6:33 pm

Re: Using a slider and updating an image field

Post by DunedinMultimedia »

This is what I have been looking for! Please does any one have a sample stack they could share? PS just got animation engine 4. Many thanks
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using a slider and updating an image field

Post by Klaus »

Hi DunedinMultimedia,
DunedinMultimedia wrote:This is what I have been looking for! Please does any one have a sample stack they could share? PS just got animation engine 4. Many thanks
What exactly are you looking for?
Need a bit more info.


Best

Klaus
DunedinMultimedia
Posts: 4
Joined: Mon Mar 07, 2011 6:33 pm

Re: Using a slider and updating an image field

Post by DunedinMultimedia »

Thank you Klaus. I have an image sequence (60 in total) that I want to display in LiveCode using a slider... similar to what you see on a QuickTime movie or a YouTube video. As you click and drag the slider button, the images change. And if possible, I would like to put navigation-type scripts on each of the images.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using a slider and updating an image field

Post by Klaus »

Hi DunedinMultimedia,

aha, I see!

Plase check my attached stack.

1. I imported 6 nice images (some ZAPPA covers :-) and noted their IDs -> Inspector for the images
2. Then I created a button "display" with the same size as the largest image (they all have the same dimension in my example)
3. I added a scrollbar (show value) with max value = the number of images I want to display
4. Added this little script to the scrollbar:

Code: Select all

local tIDList

on mouseenter
  ## I have the IDs of all my images that I want to display here in this list:
  ## Order = order of appearance
  put "1003,1004,1005,1006,1007,1008" into tIDList
end mouseenter

## This handler comes with a parameter = the current value, updated in real-time!
on scrollbarDrag tValue
  
  ## So I just pick the according item from the list and set the ICON of my button to it.
  set the icon of btn "display" to item tValue of tIDList
end scrollbarDrag
That's it :-)
And if possible, I would like to put navigation-type scripts on each of the images.
Hm, in that case you could scrpt the button with a "Switch the icon of me" condition and "react" differntly for different images
or soemthing completely different (a script for each image?), which I will have to think about :D


Best

Klaus
Attachments
el_scrubber.rev.zip
(158.96 KiB) Downloaded 461 times
DunedinMultimedia
Posts: 4
Joined: Mon Mar 07, 2011 6:33 pm

Re: Using a slider and updating an image field

Post by DunedinMultimedia »

Klaus, you are my hero :D and the Zappa covers make it even nicer! (I saw him in concert once years ago, amazing...) Thank you thank you
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using a slider and updating an image field

Post by Klaus »

My pleasure!
Drop a line if you have more questions!
linheli
Posts: 1
Joined: Mon Aug 08, 2011 11:03 am

Re: Using a slider and updating an image field

Post by linheli »

This is what I have been looking for! Please does any one have a sample stack they could share? PS just got animation engine 4. Many thanks
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using a slider and updating an image field

Post by Klaus »

Hi linheli,
linheli wrote:This is what I have been looking for! Please does any one have a sample stack they could share?
well, feel free to also load my example stack, that is not exclusivley meant for Mr. DunedinMultimedia 8)


Best

Klaus
Post Reply