Aplicar un sonido a un botón con lingo Octubre 4, 2009
Posted by EROS in scripts.trackback
Este comportamiento ejecuta un sonido en un evento predeterminado sobre un botón(mouseUp o mouseDown), se deben entrar datos como el miembro de sonido, el canal, cantidad de repeticiones(loo[), y el evento, creado por directormx...
----------------------------------------------------------------
property miembro, soundchannel, repetir, cuandorep
on getPropertyDescriptionList(me)
props = [:]
props[#miembro] = [ \
#comment: "Sonido a reproducir", \
#format: #sound, \
#default: ""]
props[#soundChannel] = [ \
#comment: "Canal de sonido", \
#format: #integer, \
#default: 1, \
#range: [1, 2, 3, 4, 5, 6, 7, 8]]
props[#repetir] = [ \
#comment: "Cantidad de repeticiones (0 = infinitas)", \
#format: #integer, \
#default: 1]
props[#cuandorep] = [ \
#comment: "Cuando reprodudir", \
#format: #string, \
#default: "On MouseDown",\
#range: ["On MouseDown","On MouseUP"]]
return props
end getPropertyDescriptionList(me)
on mouseup me
if cuandorep = “On MouseUP” then
–sound(1).play(member(miembro))
sound (soundChannel).play ([#member: miembro,#loopCount: repetir])
else
nothing
end if
on mousedown me
if cuandorep = “On MouseDown” then
–sound(1).play(member(miembro))
sound (soundChannel).play ([#member: miembro,#loopCount: repetir])
else
nothing
end if
end
on getBehaviorTooltip me
return \
“Reproduce un sonido con el evento MouseDown o\
el evento MouseUP, útil para los botones… .”
end getBehaviorTooltip
Comentarios»
No comments yet — be the first.