Skip to main content
Inspiring
April 13, 2006
Question

Control sound in timeline

  • April 13, 2006
  • 3 replies
  • 283 views
Hy,
I've some mc called, one a time, with attachMovie named mcTarget, each of
this has one speaker track sincronized with the animation on the stage. For
this reason sound is put directly in timeline in stream mode
(proprieties>>Sincr: stream). But now I cant control the volume of these
sounds. I'll tryed to do this:
//on main root
mySound = new Sound(); //no specify target to refer a "global sound"

function Volume(val){
mySound.setVolume(val);
trace(val);
}

// in another place
Volume(50);

This works only with a sound placed in main root but does nothing if the
sound is placed on a nested mc (my case).

Someone have an idea or a alternative way to do this?

Thanks
Roger


This topic has been closed for replies.

3 replies

Inspiring
April 21, 2006

"arp" <arp@stong.de> ha scritto nel messaggio
news:e1ks3c$q5f$1@forums.macromedia.com...

Any idea?
: (


Inspiring
April 13, 2006
"sneakyimp" <webforumsuser@macromedia.com> ha scritto nel messaggio
news:e1kumu$sv6$1@forums.macromedia.com...
> mySound cannot be defined as an empty sound object. it has to refer to
> the
> soundclip in question.

This is the "canonic way", but you can use that code to do a something near
at "global sound"
you can see it also in at http://www.kennybellew.com/tutorial/globally.htm.

>
> // NO
> // mySound is attempting to refer to *one specific sound*
> // *not* a global sound setting
> mySound = new Sound();
> mySound.setVolume(50);
>
> // YES
> // this is referring to one particular sound
> this.MySound1.setVolume(50);
>
> I'm not sure how this relates to sounds added to the timeline. i think
> you
> have to use the flash authoring interface controls to do it. i *don't*
> think
> you can control sounds added this way with actionscript unless you can
> determine what their target path is.

Sure, it's works with sound put in a root timeline..

> this may or may not be helpful:

Thanks, but I didn't find the solution for my case...

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

many thanks for the answer.


Inspiring
April 13, 2006
mySound cannot be defined as an empty sound object. it has to refer to the soundclip in question.

// NO
// mySound is attempting to refer to *one specific sound*
// *not* a global sound setting
mySound = new Sound();
mySound.setVolume(50);

// YES
// this is referring to one particular sound
this.MySound1.setVolume(50);

I'm not sure how this relates to sounds added to the timeline. i think you have to use the flash authoring interface controls to do it. i *don't* think you can control sounds added this way with actionscript unless you can determine what their target path is.

this may or may not be helpful:

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