home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- global curFrame, scoreData, frameCounterSpr
- set sliderSpr to the clickOn
- set shuttleSpr to sliderSpr - 1
- set hOrg to the locH of sprite shuttleSpr
- set range to float(the width of sprite shuttleSpr)
- set nbFrames to count(scoreData)
- if nbFrames < 1 then
- set nbFrames to 1
- end if
- puppetSprite(sliderSpr, 1)
- set step to range / nbFrames
- repeat while the mouseDown
- set dist to constrainH(shuttleSpr, the mouseH) - hOrg
- set curFrame to integer(dist / step)
- if curFrame < 1 then
- set curFrame to 1
- end if
- set hPos to hOrg + dist
- set the locH of sprite sliderSpr to hPos
- set the locH of sprite frameCounterSpr to hPos - 15
- put string(curFrame) into field "frameCounter"
- updateStage()
- displayFrame(curFrame, 0)
- end repeat
- if nbFrames <= 1 then
- set the locH of sprite sliderSpr to hOrg
- set the locH of sprite frameCounterSpr to hOrg - 15
- put "1" into field "frameCounter"
- updateStage()
- end if
- end
-