Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Get the computer name of user
Circular Rollover behavior
Tristate button with caption
Audio Xtra
Creating a Game Environment
Seurat-Alphamania
Moving tool tip
Auto Save and Load Text
Get Member Modified Time and Date
Installed Fonts
MediaMacros Xtras Mall
 

 

 

Behavior Volume Behaviour (Buttons)

Added on 6/25/2006

 

Compatibilities:
D9 Mac PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: davec1

This is a modified version of the Mediamacros behaviour. I have tweeked it to run on PC/Mac and MX. Drop behaviour on to an up or down volume button. Let me know if you have improved it. Cheers

property theVolume, whichWay, soundNotch, rolloverMember, defaultMember, clickMember, whatVolume, spriteNum, thisSprite

on getPropertyDescriptionList me
thisSprite = the currentSpriteNum
return [#soundNotch : [#format : #integer, #comment : "Number of sound notches:", #default : 10, #range : [#min : 1, #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(me.spriteNum).member = rolloverMember
end

on mouseLeave me
sprite(me.spriteNum).member = defaultMember
end

on mouseDown me
sprite(me.spriteNum).member = clickMember
end

on mouseUp me
sprite(me.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

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail