|
|
|
Volume Control-Button Only
Added on 10/2/2000
|
|
Compatibilities:
Required Xtras:
Buddy API
|
This item has not yet been rated
|
This behavior is similar to the slider sound behavior but involves only an up and down button. Simply drag and drop and assign which is the up and which is the down button. Note that the sound notches can be different on this one.
property theVolume, whichWay, soundNotch, rolloverMember, defaultMember, clickMember, whatVolume, spriteNum
on getPropertyDescriptionList me
thisSprite = the currentSpriteNum
return [#soundNotch : [#format : #integer, #comment : "Number of sound notches:", #default : 10, #range : [#min : 5, #max : 30]], #rolloverMember : [#format : #member, #comment : "Rollover member", #default : (sprite thisSprite).member], #clickMember : [#format : #member, #comment : "Click member", #default : (sprite thisSprite).member], #whatVolume : [#format:#string, #comment : "What sound device?", #default : "Master", #range : ["Master", "CD", "Wave", "Midi", "Synth"]], #whichWay : [#format:#string, #comment : "Which Button", #default : "Up", #range : ["Up", "Down"]]]
end
on mouseEnter me
(sprite spriteNum).member = rolloverMember
end
on mouseLeave me
(sprite spriteNum).member = defaultMember
end
on mouseDown me
(sprite spriteNum).member = clickMember
end
on mouseUp me
(sprite spriteNum).member = defaultMember
eachJump = 100.0/soundNotch
if whichWay = "Up" then
newVolume = baGetVolume(whatVolume) + eachJump
if integer(newVolume) >= 100 then
newVolume = 100
end if
else
newVolume = baGetVolume(whatVolume) - eachJump
if integer(newVolume) <=0 then
newVolume = 0
end if
end if
baSetVolume(whatVolume, integer(newVolume))
end
on beginSprite me
theVolume = baGetVolume(whatVolume)
defaultMember = (sprite spriteNum).member
end
on getBehaviorDescription me
describe = "This behavior is similar to the slider sound behavior but involves only an up and down button. Simply drag and drop and assign which is the up and which is the down button. Note that the sound notches can be different on this one."
return describe
end
|
|