home *** CD-ROM | disk | FTP | other *** search
- property mySprite, myMemb, maxRight, minLeft
-
- on beginSprite me
- set mySprite to the currentSpriteNum
- set myMemb to the memberNum of sprite mySprite
- set minLeft to the locH of sprite (mySprite - 1) - (the width of the member of sprite mySprite / 2)
- set maxRight to minLeft + 128
- set the locH of sprite mySprite to minLeft + (the volume of sound 1 / 2)
- set the locH of sprite (mySprite + 1) to the locH of sprite mySprite
- end
-
- on mouseEnter me
- cursor(260)
- end
-
- on mouseLeave me
- cursor(-1)
- end
-
- on mouseDown me, force
- if not force then
- cursor(290)
- set offset to the locH of the clickLoc - the locH of sprite mySprite
- set oldLoc to the locH of the clickLoc + offset
- repeat while the mouseDown
- set newLoc to min(maxRight, max(minLeft, the mouseH - offset))
- if not (newLoc = oldLoc) then
- set the locH of sprite mySprite to newLoc
- set the locH of sprite (mySprite + 1) to the locH of sprite mySprite
- updateStage()
- set oldLoc to newLoc
- end if
- end repeat
- set the volume of sound 1 to (the locH of sprite mySprite - minLeft) * 2
- else
- set the locH of sprite mySprite to minLeft + (the volume of sound 1 / 2)
- set the locH of sprite (mySprite + 1) to the locH of sprite mySprite
- end if
- puppetSound(1, "testSnd")
- updateStage()
- if not force then
- cursor(260)
- end if
- end
-