How to make a button make a sound using Hackety Hack

With some help from Steve, I made a button on Hackety Hack that make a sound when you press it. Pretty neat, here’s the code if you want to check it out.

require “bloops”
Shoes.app do
button “boing” do  (this is where you write what you want your button to say)
@sound = Bloops.sound 0
@sound.type = 0
@sound.sustain = 0.25
@sound.decay = 0.19
@sound.freq = 0.58
@sound.slide = 0.11
@sound.square = 0.27
(these numbers were randomly generated by the Sound Foley, which can be pulled up by typing sound and the pressing tab)
@sound.test
end
end

 

-Merritt

~ by mlw53 on November 13, 2010.