Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Generic Slider w/Text
Menus like VB
ControlXtra
Faux Typing
Flash Component Label
Play Sound of Member
Go Marker of a Movie in current Directory
All purpose status bar
SpritePulsator
Grabber
 

 

 

Behavior Volume Control-Button Only

Added on 10/2/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: MediaMacros (website)

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

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail