Could someone kindly post some sample code of how to attach a sound to the accordion component when each selection is clicked?
i tried
var s:sound = newSound();
s.attachSound("click");
but failed.
mucho gracias
Printable View
Could someone kindly post some sample code of how to attach a sound to the accordion component when each selection is clicked?
i tried
var s:sound = newSound();
s.attachSound("click");
but failed.
mucho gracias
you would need to set up a listener, listening for the 'change' event to be broadcast.
Code:var s:Sound = new Sound(this);
s.attachSound("click");
var listenerObject:Object = new Object();
listenerObject.change = function(eventObject:Object)
{
s.start();
};
// where acc is the name of your accordian component
acc.addEventListener("change", listenerObject);
thanks for the reply. i tried your code but it gave 5 errors, all with this...
"Statement must appear within on/onClipEvent handler"
thanks again.
The code is meant for the timeline, not on a movieClip
What aboout when you want a sound to play when mouse-over/rollover the accordion headers?
Phil