On Wednesday, May 09, 2001 4:09 PM, Conrad Ayala wrote:
>Is there a lingo script out there that can lower the volume of a sound 
>channel while the button is being pressed down?

erhm... i'm late on this, but better late than never... right?

i did a slider volume thing for a project in my last term at college. it
was a vertical slider (that's up and down, right?) and the length of the
sliding "groove" was 38 pixels. it was at position 596,181,598,219 on the
stage.

here's my code, written in Director 7 (circa. A.D. 2000), but working well
in Director 8 (circa. tuesday evening):

---------begin Lingo---------

on mouseDown me
  mouseSliderOffset = sprite(me.spriteNum).locV - the mouseV
  repeat while the mouseDown
    case TRUE of
      (the mouseV + mouseSliderOffset) > 214:
        sprite(me.spriteNum).locV = 214
        set the member of sprite 6 to "e6"
      (the mouseV + mouseSliderOffset) < 186:
        sprite(me.spriteNum).locV = 186
        set the member of sprite 6 to "equalizer"
      (the mouseV + mouseSliderOffset) <= 214:
        sprite(me.spriteNum).locV = the mouseV + mouseSliderOffset    
    end case
    sliderValue = integer((sprite(me.spriteNum).locV - 214) * -6)
    set the volume of sound 1 to sliderValue
    put sliderValue
    updateStage    
  end repeat  
end

---------end Lingo---------

i attached this to the volume knob, and constrained the "knob" graphic to
the "groove" graphic. hope this is useful to someone.

cheers,



                                parker




--
"But that was in another country, and besides, the wench is dead."
                                - C. Marlowe, "The Jew of Malta"



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to