Date: Mon, 14 Nov 1994 11:52:40 -0800 From: BosaiyaThis is a reconstruction and modification of a script by Gary Sadavage, which will keep track of where your position is and post the location to a text field (which you can easily change to a variable).Subject: Re: sliders
Or you can buy the CD "Interactive Buttons and Controls" by Staz Software.
on initSlider
global L
puppetsprite 5, true (5 is the slider handle)
set L = the left of sprite 4
end
on goSliding
global L
puppetsprite 5,true
puppetsprite 2,true
repeat while the stillDown
set newH = constrainH(4,mouseH())
set the locH of sprite 5 to newH
set newValue = (newH - L)/increment
setMeterValue newValue -- (this displays the current position in a text field)
updateStage
end repeat
updatestage
end
on setMeterValue value
set the text of cast "Position" to string (value)
end
Date: Tue, 15 Nov 1994 12:09:06 +1100 From: Nguyen Thuy LinhFirst make the slider movable by checking the Movable property on the left-hand side in the Score window for the slider sprite.Subject: Re: sliders
To constrain the movement of the slider :
on exitFrame go to the frame end on mouseDown set the constraint ofsprite to end
on mouseUp
if the locH of <slider> sprite = <certain value> then
put <the return value> into <your var>
else if the locH of <slider> sprite = <other value> then
put <other return value> into <your var>
else ......
end if
end
Date: Wed, 12 Jan 1994 01:27:10 -0800 From: Roger JonesHere's some code for a horizontal slider that sets qt volume:Subject: Re: Audio fader(s) for director
--Quicktime volume control using lingo --Based on slider example by Chuck Walker --Example by Roger Jones 1/92 --Revised 1/95 on startMovie global increment,L,qtsprite,sliderbarsprite,sliderthumbsprite,maxVolume set qtsprite = 3 -- the quicktime movie's sprite channel set sliderbarsprite = 11 -- the slider bar's sprite channel set sliderthumbsprite = 12 --the slider thumb's sprite channel -- OverDriveRate allows you to overdrive the sound to increase its max volume. -- Sort of like having 11 on your Marshall stack --Try values from 1 to 4. Default is 1 set overDriveRate = 1 set maxVolume = overdriveRate * 255 PuppetSprite sliderthumbsprite,TRUE -- For slider. --set the immediate of sprite sliderthumbsprite to TRUE -- arcane lingo set increment = float(maxVolume/the width of sprite sliderbarsprite) set L = the left of sprite sliderbarsprite updatethumb --updates the thumb to the current volume setting endAttach this script to the slider thumb in the score using on mouseDOWN.
on mouseDown
SliderActive
end
on SliderActive
global increment,L,qtsprite,sliderbarsprite,sliderthumbsprite,maxVolume
if the type of sprite qtsprite <> 16 then exit -- optional error check
repeat while the stillDown
set newH = constrainH(sliderbarsprite,mouseH())
set the locH of sprite sliderthumbsprite = newH
set the volume of sprite qtsprite = ( newH - L ) * increment
updateStage
end repeat
end
Use this to update the thumb if necessary
on updatethumb global increment,L,qtsprite,sliderbarsprite,sliderthumbsprite if the type of sprite qtsprite <> 16 then exit -- optional error check set the locH of sprite sliderthumbsprite = (the volume of sprite qtsprite / increment) + L end