-
Attaching sound to Accordion Component
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
-
Monkey Moderator
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);
www.lexicon-design.co.uk
If we aren't supposed to eat animals, then why are they made of meat?
If Vegetarians like animals so much, why do they eat all their food?
-
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.
-
Monkey Moderator
The code is meant for the timeline, not on a movieClip
www.lexicon-design.co.uk
If we aren't supposed to eat animals, then why are they made of meat?
If Vegetarians like animals so much, why do they eat all their food?
-
What aboout when you want a sound to play when mouse-over/rollover the accordion headers?
Phil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|