Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / May 2005



Tip: Looking for answers? Try searching our database.

A little trouble with sound!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oli-G - 31 May 2005 16:40 GMT
Hi guys

I have a movie clip on the main timeline. Within it, are several other movie
clipe. I want a looping sound to be triggered when each member is clicked. here
is the following code I have, but so far it aint working! I set them all to
play initially, so that they are in sync. I imagine this is just a linkage
issue of sorts.

stop();
this.createEmptyMovieClip('sound1Holder', 100);
this.createEmptyMovieClip('sound2Holder', 101);
this.createEmptyMovieClip('sound3Holder', 102);
guitar = new Sound(sound1Holder);
drumbass = new Sound(sound2Holder);
tribal = new Sound(sound3Holder);
guitar.attachSound('guitar');
drumbass.attachSound('sound2');
tribal.attachSound('sound3');

guitar.setVolume(0);
drumbass.setVolume(0);
tribal.setVolume(0);

guitar.start();
guitar.onSoundComplete = function() {
    this.start();
};
drumbass.start();
drumbass.onSoundComplete = function() {
    this.start();
};
tribal.start();
tribal.onSoundComplete = function() {
    this.start();
};
//silence_btn.onRelease = function() {
//mother_mc.gotoAndPlay(11);
//child_mc.gotoAndPlay(11);
//girl_mc.gotoAndPlay(11);
//};
blinds_mc.onRelease = function() {
    blinds_mc.gotoAndPlay(2);
};
ears_mc.onRelease = function() {
    ears_mc.gotoAndPlay(2);
};
gunk_mc.onRelease = function() {
    gunk_mc.gotoAndPlay(2);
    rightface_mc.gotoAndPlay(2);
};
leftface_mc.onRelease = function() {
    leftface_mc.gotoAndPlay(2);
};
boy_mc.onRelease = function() {
    boy_mc.gotoAndPlay(5);
    sound1.setVolume(100);
};

At the moment im just focusing on getting the one with boy_mc to work... any
ideas?

cheers
David Stiller - 31 May 2005 21:30 GMT
Oli-G,

   I see you setting the volume to zero here ...

> guitar.setVolume(0);
> drumbass.setVolume(0);
> tribal.setVolume(0);

... but never setting the volume for any of those to 100 (or anything else).
For example ...

> boy_mc.onRelease = function() {
>  boy_mc.gotoAndPlay(5);
>  sound1.setVolume(100);
> };

   What is sound1?  It's not a reference to guitar, drumbass, or tribal, is
it?  Keep in mind your pathing, too.  The function you've attached to the
onRelease event handler is scoped to boy_mc.  Whatever sound1 is, it is
therefore scoped to boy_mc, which means boy_mc must have a property named
sound1 -- or you need to correctly path to sound1 -- but why aren't you
setting the volumes of your previously named Sound instances to something
higher than zero?

David
stiller (at) quip (dot) net
"Luck is the residue of good design."
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.