home *** CD-ROM | disk | FTP | other *** search
- -- card: 2818 from stack: in
- -- bmap block id: 2276
- -- flags: 0000
- -- background id: 2722
- -- name:
-
-
- -- part 2 (button)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=119 right=131 bottom=114
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Fader 1 Control
- ----- HyperTalk script -----
- on mouseStillDown
- -- set constants
- put 100 into vMin
- put 200 into vMax
- put 100 into hVal
- put 10 into divisions
- -- calculate jump values
- put (vMax-vMin)/(divisions*2) into offset
- get item 2 of the mouseLoc
- if it > vMin and it < vMax then
- set loc of button id 2 to hVal,offset+it-(it mod 10)
- put vMax-(it-(it mod 10)) into card field "Fader value"
- else if it > vMax then
- set loc of button id 2 to hVal, offset+vMax
- put 0 into card field "Fader value"
- else if it < vMin then
- set loc of button id 2 to hVal, offset+vMin
- put 100 into card field "Fader value"
- end if
- end mouseStillDown
-
-
-
- -- part 10 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=91 top=214 right=228 bottom=114
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: Fader value
-
-
- -- part 11 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=215 top=100 right=208 bottom=493
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name:
-
-
- -- part 12 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=41 top=229 right=247 bottom=160
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Edit my script
- ----- HyperTalk script -----
- on mouseUp
- edit script of button id 2
- end mouseUp
-
-
-
- -- part contents for card part 10
- ----- text -----
- 80
-
- -- part contents for card part 11
- ----- text -----
- This simple stack shows how to simulate a control similar to the volume control in the control panel.
-
- The tracking is not fast enough. Some optimization of my script would probably improve it a lot.
-
- Please feel free to use any part of this stack in your own creations.
-
-
-