Sliders & Images

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Aug 5 09:00:18 EDT 2008


Here is the explanation:
The scrollBarDrag message is sent by the engine every time that the  
'real' thumb position has changed by one pixel.
So this message may fire several times in some milliseconds if you  
move the thumb quickly.
On the other hand, 'beep' sound is longer than that.
Then if a new beep is required when the previous one is not finished  
to be played, it's queued and executed when the previous is finished.
With all beeps you have heard, it's easy to understand now why a  
condition might be welcome.
:-)

Le 5 août 08 à 14:49, H Baric a écrit :

> That's what I did Eric, well I'm pretty sure I did! (on  
> scrollbarDrag thePos
> ; set the icon of btn "bgImage" to the id of img ("blue" &  
> thePos) ; beep)
>
> Though I just tried again, and my beeps aren't oh wait there it  
> goes HAHA.
> Only about 20 seconds after I moved the slider hahahaha
>
> I reallly need a new computer maybe?
>
> * Actually my "beep x" doesn't work either most of the time. I  
> generally
> never get the same number I state. :(
>
> My PC *is* a bit of a dino now I guess.
>
> Cheers,
> Heather
>
>
> ----- Original Message -----
> From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Sent: Tuesday, August 05, 2008 10:18 PM
> Subject: Re: Sliders & Images
>
>
> Sorry I was not clear enough:
> Add a 'beep' in your scrollbarDrag handler and you will hear
> continuous beeps when dragging scrollbar's thumb even if the reported
> thumb position in the scrollbarDrag handler does not actually change.
>
> Le 5 août 08 à 14:18, H Baric a écrit :
>
>> Thanks for making that clear Eric.
>>
>> Well I just added beep, and I get just ONE beep. Then it's done.
>>
>> Maybe my system is as lazy and tired as me :-D
>>
>> Cheers,
>> Heather
>>
>>
>> ----- Original Message -----
>> From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
>> To: "How to use Revolution" <use-revolution at lists.runrev.com>
>> Sent: Tuesday, August 05, 2008 9:49 PM
>> Subject: Re: Sliders & Images
>>
>>
>> Add a 'beep' in your scrollbarDrag handler and you will hear
>> continuous beeps even if the thumb position does not actually change:
>> So adding a condition to check if the image has to change is a good
>> idea because without it you'll change the image continuously even if
>> it's not needed:
>> This means CPU use, screen refresh, etc. even if you don't notice
>> anything.
>> Just good practice :-)
>>
>> Le 5 août 08 à 13:22, H Baric a écrit :
>>
>>> "not run the code if it's not needed"
>>>
>>> Sorry Eric can you please explain why or when it wouldn't be?
>>>
>>> Thanks!
>>>
>>> Cheers,
>>> Heather
>>>
>>>
>>> ----- Original Message -----
>>> From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
>>> To: "How to use Revolution" <use-revolution at lists.runrev.com>
>>> Sent: Tuesday, August 05, 2008 8:48 PM
>>> Subject: Re: Sliders & Images
>>>
>>>
>>> Mark's idea sounds good because it does not reorganize layers but I
>>> would add a condition to not run the code if it's not needed:
>>>
>>> on scrollbarDrag thePos
>>>     if the icon of btn x <> the id of img ("blue" & thePos) then
>>>      set the icon of btn x to the id of img ("blue" & thePos)
>>>    end if
>>> end scrollbarDrag
>>>
>>> Le 5 août 08 à 12:45, H Baric a écrit :
>>>
>>>> Excellent! Merci!
>>>>
>>>> ----- Original Message -----
>>>> From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
>>>> To: "How to use Revolution" <use-revolution at lists.runrev.com>
>>>> Sent: Tuesday, August 05, 2008 7:37 PM
>>>> Subject: Re: Sliders & Images
>>>>
>>>>
>>>> on scrollbarDrag pPos
>>>>    set the layer of img ("blue" & pPos) to top
>>>> end scrollbarDrag
>
>
> Best regards from Paris,
> Eric Chatonet.


Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list