-
(flash MX 6.0) plz help me create sound on/off button
hi all,
very fresh in flash
u know these buttons on websites that turn off sound and then back on once clicked again? i wana add one of these to my website which im building in flash MX 6.0. now i have a botton that says
on (release) {stopAllSounds();
}
bu ti dont know what to add so that when i click it again the sounds comes back from mute.
im hoping someone could plz help me it will be really appreciated.
ps: whats the differense between event and a start music file?
thanks a lot guys this is much appreciated.
-
Hey mhafez100
Here is a very good tutorial on sound objects with almost everything you need to know about sounds. Just a tip about your code try not to attach any AS to any object, good practice is to use frame action instead ( that means attaching code to a frame).
http://www.flashkit.com/tutorials/Au...-824/index.php
finally quick answer to your question, try this:
PHP Code:
//myBtn is the instance name of my button on the stage
mySound = new Sound ();
mySound.attachSound ("sound2");
playing = false;
myBtn.onPress = function ()
{
if (playing == false)
{
mySound.start ("sound2");
playing = true;
}
else
{
mySound.stop ("sound2");
playing = false;
}
};
-
thanks a lot flashsmashed, this is highly appreciated. i'll give it a shot. the tutorial is great too!
thanks again
-
No problem
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
|