Page 1 of 1

Using a slider and updating an image field

Posted: Thu Jul 16, 2009 9:12 pm
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.

Posted: Thu Jul 16, 2009 10:41 pm
by malte
Hi Chibling,

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

Hope that helps,

Malte

Works!

Posted: Thu Jul 16, 2009 10:54 pm
by Chibling
Hello responder,

thank you so much, that is exactly what I needed!

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 10:27 am
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

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 10:41 am
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

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 4:43 pm
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.

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 5:24 pm
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

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 6:49 pm
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

Re: Using a slider and updating an image field

Posted: Wed Jul 27, 2011 7:48 pm
by Klaus
My pleasure!
Drop a line if you have more questions!

Re: Using a slider and updating an image field

Posted: Mon Aug 08, 2011 11:05 am
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

Re: Using a slider and updating an image field

Posted: Mon Aug 08, 2011 1:04 pm
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