To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Sounds and Music

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-31-2007, 03:30 PM   #1
zdesigns
Member
 
Join Date: Oct 2001
Posts: 48
Controlling Multiple Sounds

Hey everyone I'm having a problem with controlling 3 different sound. Just to let you know I'm an amature at this actionscripting stuff so I try to find things that are already done and I can figure out how to tweek it for my needs. Well I'm using the code below for each sound and it works great until I click a button to go to the next sound. If the sound is still going from the first one - the next one will overlap. I'm trying to make the sound stop when I click a forward or back arrow while the next sound plays. Any help would be much appreciated. Thanks.

bgSound = new Sound(this);
itquit = false;
itgoes = true;
bgSound.attachSound("audio1");
bgSound.start();
slider.slideBar._x = -30;
function adjustVolume()
{
bgSound.setVolume(0 - 3.4 * this._x);
}
slider.slideBar.onEnterFrame = adjustVolume;
slider.slideBar.onPress = function()
{
slider.slideBar.onEnterFrame = adjustVolume;
startDrag(this, false, -30, 0, -3, 0);
};
slider.slideBar.onRelease = slider.slideBar.onReleaseOutside = function ()
{
stopDrag();
};
Btn_Mute.onPress = function()
{
if (bgSound.getVolume() != 0)
{
oldVolume = bgSound.getVolume();
slider.slideBar.onEnterFrame = null;
bgSound.setVolume(0);
}
else
{
slider.slideBar.onEnterFrame = adjustVolume;
bgSound.setVolume(oldVolume);
}
};
zdesigns is offline   Reply With Quote
Old 07-31-2007, 05:05 PM   #2
hp3
Moderator
 
Join Date: Apr 2001
Location: Akron OH, USA
Posts: 4,821
-----
If the sound is still going from the first one - the next one will overlap. I'm trying to make the sound stop when I click a forward or back arrow while the next sound plays.
-----
please only post the code relevant to your problem. Your code consists largely of volume control features which do not seem to be part of your problem. When you post code that is not relevant to the problem, people will wonder if you understand the code you are using, and consequently not understand their suggested code solution, and may not put forth the effort to help.

Also it is frustrating for someone to read about a problem, such as forward back buttons, and not see any code related to forward or back.

So, I would suggest that in the future, if you are hoping for people to help you, please consider that you need to provide relevant information in your post.
__________________
aviarts.com - web development and flash development
hp3 is offline   Reply With Quote
Old 07-31-2007, 05:57 PM   #3
zdesigns
Member
 
Join Date: Oct 2001
Posts: 48
Thanks for the input - I cleane up the code and I'll post a new thread with a .fla for people to see an example. Like I said before I'm an amature at actionscripting. Thanks.
zdesigns is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > General Help > Sounds and Music

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:59 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.