Solved

Controlling sound volume for multiple sound objects across multiple scenes.

Posted on 2006-06-12
16
219 Views
Last Modified: 2010-04-03
I have a client with a project that has a dozen scenes or so. I normally avoid working with scenes, so I'm not sure how to address this problem.

The issue is that he is controlling multiple sound object independently- Meaning, that he has each sound object associated with a movie clip on the scene so he can have different volume level controls for each sound.

e.g.:

sound1 = new Sound(Sound1MC);
sound1.attachSound("Sound1.aif");

The problem is that when he moves to a different scene, he no longer has access to the movies that were associated with the sound object, and he loses control of the audio.

Is there a way to control multiple sound objects across scenes in this manner?  For example, if I assigned the sounds like:

_root.createEmptyMovieClip('sound_mc', _root.getNextHighestDepth());
_root.soundObject = new Sound(_root.sound_mc);

Would this solve the problem?  Or how?
0
Comment
Question by:Aspirin99
  • 7
  • 4
  • 2
16 Comments
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16886515
Hi
There is no need to associate the sound object with any movie clip
simply in the 1st frame or so , create your sound objects

sound1=new Sound()
sound1.attachSound("Sound1_id")

// please note that attachSound gets sound id , meaning that the sound file is already in the library, but if you want to load it , then you use  .loadSound("sound_file.mp3")

after you create all your sound object , you can control it anywhere (but you have to call its path right)
to avoid mistakes you can
_root.sound1.setVolume(50)

Regasrds,
Ramy
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 16886630
I think you're not aware that if you do it that way, you cannot controll the volume of one sound independent from another sound. That's why you have to associate it with its own movie - like an empty movie.
0
 
LVL 7

Accepted Solution

by:
Ramy_atef earned 250 total points
ID: 16886845
Sorry, i got mixed up

_root.createEmptyMovieClip('sound_mc1', _root.getNextHighestDepth());
_root.sound1 = new Sound(_root.sound_mc1);
_root.sound1.attachSound("a");
_root.sound1.start(0, 5);
//
_root.createEmptyMovieClip('sound_mc2', _root.getNextHighestDepth());
_root.sound2 = new Sound(_root.sound_mc2);
_root.sound2.attachSound("b");
_root.sound2.start(0, 5);
//

and so on..
that should do it

Regards,
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 16887241
Ramy,

Did you test this or have any experience with it?  I just set up and test and can't get that to work.

Here's the FLA I tested with.

http://www.cowfly.com/test/misc/test.zip

Thanks.
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 16887356
Actually, I think I got it to work, but I have to reassign the volume level on each scene.
0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16887445
Hi

Acutally i tested it, and it workd fine with me ..
do u want me to test your file or it is working now ?

Regards,
Ramy
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:Aspirin99
ID: 16889246
I think we're done. Thanks for your help.
0
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16889261
welcome :)
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 16892456
just a thought, assuming you did go with the movieclip option - you could store all the movies in a global array, and reference them accordingly at any point throughout the movie.
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 16893647
Would the global array affect the problem of losing the association with the movie when I load a new scene? I would be happy to open a new question if this line of reasoning has value.  With the approach outlined using createEmptyMovieClip, I still have to reset the volume levels at the start of each scene, which seems to be due to losing contact with the movies associated with the sound object's original definition.
0
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 250 total points
ID: 16894146
if you're losing association with your clips but they're referenced in a global array you can then access it through referencing the array, that's all i was thinking.
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 16894316
Thanks, I see what you're saying.
0
 
LVL 1

Author Comment

by:Aspirin99
ID: 17918752
I don't care how you split it, as I pay a monthly fee for access. However, I have created a more complete solution here:

http://www.kennybellew.com/tutorial/multiple_scenes.htm

For those who might search for a similar solution.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Updating Flash Player with GPO 3 347
Adobe flash player fails to install 12 302
Firefox fullscreen video lags 4 155
black magic design 1 121
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now