Controlling Timeline sound in AS3

Hello everyone,
I have a timeline with a sound in it set to sync because I am
scrubbing the main timeline....
I now want to control the volume of the sound in the
timeline..is that possible in AS3??
sometime like : var my_globalSound:Sound = new Sound(stage);
that of course doesn't work, but how would I get access to
the sound set in the timeline...
thanks!

Thanks to all of you I was struggling with the same thing.
The given code work perfectly for me.
SoundMixer.soundTransform = new SoundTransform(0, 0); //volume, pan
My issue: I am loading and external swf file(as3.0) wich have audio on timline and I want volume controller for that audio.

Similar Messages

  • Controlling timeline sound

    Hey guys, i was wondering if you would be able to help, PLEASE!!
    I'm making a presentation in flash, it has 3 segments, 1st is sound in sync with timeline 2nd is a video which is streaming and third is sound insync with timeline again.
    I can control the video thats no probs, but i want to be able to control the sound/timeline.
    What i want to be able to do is put in some controls just pause play and stop and when i push pause it obviously pauses it, when i push play it continues to play and when i push stop it goes to frame 1 and clears what ever it was playing in the timeline previously.
    I know how to control the timeline but not the sound!
    any suggestions please?

    You will find sound quality options for individual sounds if you double click on the sound in the library.
    If you look in your Flash Publish Settings you will find sound quality options for all streaming/event internal sounds. These global settings can optionally override individual sound quality settings.

  • How to control timeline sound of external SWF

    Hi All,
    Basic Intro:
    I am new in Action Script and trying to create a video tutorial framwork. In this I have lots of animated SWF files in all the files I have multiple scenes as those are 5min. to 10 min. each and all the files have the relevent background and nurration voice place directly on the TIMELINE frame by frame to match lip syncing animated chreactors.
    My file structure :
    Login.swf with login box is embedded into the Index.html
    After logged in it will load another SWF which is Control panel.swf
    3. Controlpanel.swf has the controls to control the loaded external swf files i.e.: Chapter menu, Play, pause, replay, volume-bar, next and previous buttons.
    By Default Controlpanel.swf will open chapter1.swf as soon as user logged in so no one need to open 1st file.
    Here user can navigate to other chapter swf file through Chapter menu or Next and Previous buttons.
    All files are loading and playing properly, here I am trying to control the animation and Sound both at a same time with Pause, Play and Replay through relevant buttons.
    Problem:
    By pressing “Pause button” animation stops but not the sound. Sound remains playing, and if I replay the swf by “Replay button” than animation restarts but sound also restarts that overlaps already playing audio.
    Question: So could anybody help me finding out how to:
    1. Pause the sound with animation by the same click of Pause button, and
    2. Stop the sound with animation by the same click of Stop button, and
    3. On replay it should stop playing the previously running audio and restart it with the animation like fresh loaded file, it should not sound overlapping.
    Constraints:
    Here I am using the sound file on the same time line of each individual swf file which I cannot add into any single movie clip because all the chapter swf file are having multiple scenes in it.
    For my problem I have already done a lot of browsing online in various forums and didn't find the solution. So here I am sharing the complete information regarding the project and wishing to get some good solution out here but if I missed any helpful information please ask me anytime and please help me to quickly find out the solution.
    Thanks a lot to all of you in advance to help me.

    create one global sound variable
    you can write when you are pressing pause button
    globalsoundvariable.setVolume(0)
    to play
    globalsoundvariable.setVolume(100)

  • AS3: How to access and control embedded sounds in an external swf?

    I rarely use sounds in AS3/Flash. I am using Flash Pro CS6, but I can't seem to figure out how to access, control (play, stop, etc) sounds embedded in an external SWF loaded into the main SWF.
    It's easy to control them when embedded on the main swf. However, on an externally loaded SWR, I get all kinds of errors. For this app, I really need to embed them in the external SWF.
    I read several solutions, but none seem to work.
    I embed the sound an mp3 file called soundSegment1.mp3 using Flash CS6 import tool and then open the actionscript properties panel on flash to select the class name: SoundSegment1. Then I edit the class code and create a file called SoundSegment1.as and it's saved right next to my document class main.as in the same directory. The code of the SoundSegment1 class looks like this:
    package  {
        import flash.media.*;
        public class SoundSegment1 extends Sound
            public function SoundSegment1 ()
                // no code in here
            public function playSound()
                var soundSegment1:Sound = new SoundSegment1();
                var channel:SoundChannel = soundSegment1.play();
    Then, in my main.as, I have done several attempts to play this sound such as:
    var fileLocation:URLRequest = new URLRequest(SWFToLoad); loader.load(fileLocation); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListener); loader.contentLoaderInfo.addEventListener(Event.INIT, initListener); 
    function initListener(e:Event):void // I also placed this code on the completeListener and it didn't work {      loader.content.soundSegment1.playSound(); // doesn't work.  }
    I get:
    Line XXX 1061: Call to a possibly undefined method playSound through a reference with static type flash.display:DisplayObject.
    or, I also read that I should be able to do something like this anywhere in the Main.as file:
    var theClass:Class = Class(loader.content.getDefinitionByName("SoundSegment1")); var theSound:theClass = new theClass(); theSound.play()  //doesn't work either.
    I also tried on the completeListener:
    var TheClass:Class = e.target.applicationDomain.getDefinition("SoundSegment1") as Class; var theSound:TheClass = new TheClass();
    theSound.play()  //doesn't work either.
    I get:
    ReferenceError: Error #1065: Variable SoundSegment1 is not defined. at flash.system::ApplicationDomain/getDefinition()
    I am stuck and I really need to get this to work. I would be genuinely grateful for your help.
    Thank you in advance for any help provided. I really need to get it to work, because I can't simply embed them in the main SWF or load them individually externally one by one.
    Thanks again!

    THANK YOU!
    I think your code may be over my head though. I think you are using an anonymous function which is not something I am familiar with (but I want to learn about if it's useful).
    I also don't know where the classS came from. I see that it's a parameter sent along with the event, but I don't really see where that came from.
    Someone at: http://www.kirupa.com/forum/showthread.php?305098-Playing-a-embedded-sound-in-an-external- swf&p=2658098#post2658098
    Is showing what seems to be an easier solution, but my problem there is I can't access the source file of the "child" swf....  ayayay.....
    I am going to tinker with your solution and see if it gets me anywhere. Thanks so much for your help again.

  • Controlling the sound of the external loaded SWF

    I  have a Loader that loads external SWF. The external SWF has sound.
    I'd like to stop, pause and play the sound.
    How?
    Please help me !
    var loader:Loader = new Loader();
    loader.load(new URLRequest("moora.swf"));
    addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loader_complete);
    var mc:MovieClip;
    var st1:SoundTransform = new SoundTransform();
    var sn:Sound = new Sound();
    var ch:SoundChannel;
    var offset:Number = 0;
    function on_loader_complete(e:Event):void
         mc = MovieClip(loader.content);
         play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
         pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
         stop_btn.addEventListener(MouseEvent.CLICK, on_stop_btn);
         trace(mc.totalFrames);
    function on_play_btn(e:MouseEvent):void
         mc.play();
         st1.volume = 1;
         mc.soundTransform = st1;
    function on_pause_btn(e:MouseEvent):void
         mc.stop();
         st1.volume = 0;
         mc.soundTransform = st1;
    function on_stop_btn(e:MouseEvent):void
         mc.gotoAndPlay(1);
    mc.soundTransform = st1;
    This only mute the sound only and the sound is still runnung.

    The loaded external SWFs are AS3. The sound is on the timeline. Some SWFs use loaded sound, Here is its code:
    var snd:Sound = new Sound();
    var req:URLRequest = new URLRequest("moora.mp3");
    snd.load(req);
    So, how can I control the sound (Stop, Pause, resume).

  • The sound of my iphone has dissapeared when I play games and when i listen to muisic but when I put the headphones the sound come back and I can control the sound,what should I do??

    I was on a boat ride when some water fell on it but it was just a little bit then when i tried to control the sound and volume while playing and listening to music it didn't showed anything and just with headphones it appeared again and i could listen and I could control it again but when i take the headphones out it goes back to the same thing.What should I do??

    try toggling the Ducking menuItem

  • Inspiron 1525 not able to select internal mic for webcam, nor is it showing up on Control Panel, Sound, Audio Devices

    Initial problem was Dell Webcam video recording records no sound.
    In Control Panel, Device Manager, Sound Video and Game Controllers there are two High Definition Audio Devices listed: Location 1 (Internal High Definition Audio Bus) - I deduce this is the internal mic; and Location 2 (Internal High Definition Audio Bus) - I deduce this is external microphone jack. Both have the same driver version.
    The Control Panel, Sound, Recordings Tab showed 2 devices that looked identical except the bars that show green with volume were only on the first one, which is also the default one, and would detect sound if you got real close to the webcam mic when talking. Both devices displayed as 'working'.
    Accessories, Sound Recorder recordings are silent no matter how close you get to internal webcam mic.
    Dell WebCam Audio Source tab has two selections, both reading Microphone (3 - High Definition Audio Device). Both selections record sound with the EXTERNAL MIC jack. There is no way to select the internal webcam mic, it is not an option.
    Per instructions found on the web, I uninstalled the first device only in Device Manager and rebooted. The same driver version as before was installed. But now the settings have changed. Device Mgr still shows Loc 1 and Loc 2. However, under the Sound, Recordings tab there are still 2 devices, but the first one says 'currently unavailable' , is still the default, and the sound bars that go green for audio testing are on the SECOND device now instead of the first one. If you check the Properties for each device, they BOTH are showing the same location Location 2 (Internal High Definition Audio Bus), i.e., the external mic jack.  Loc 1 device (built in mic) is not showing up!!
    Accessories Sound Recorder works with the EXTERNAL mic. (How does it know which one to use, it's not giving me a choice?)
    So the Location 1 device (internal mic) is not showing up anywhere besides the device manager. I want to use the internal mic for skype and webcam. Somehow I need to get the Loc 1 device to show up on the Sound - Recording tab and in the Webcam Audio Source list? What do I do?
    Thank you in advance for your help.

    kestark
    This is Vista.
    Go to the Inspiron 1525 support page. Find the small blue "Change OS" and click on the arrow. Select Vista.Then download and install these 3 items with a restart between each one.
    1. Dell System Software in the System Utilities category.
    2. Intel Mobile Chipset in the Chipset category.
    3. Sigmatel audio driver in the Audio category.
    See if it works any better after you get the Sigmatel driver installed.

  • Can the Sound Object control two sounds at once?

    I have a sound object that I want to control two seperate
    sounds in different movie clips..one is intro music which lives on
    the main shell of the website along with the sound object. This
    fades out into a loop that lives on another movie clip that loads
    into the shell on a loadMovie action naturally.
    My goal:
    To control both sound clips with ONE sound object living in
    the main flash site's shell. Can this be done or would I have to
    have two seperate sound objects for each sound clip?
    Thank you,
    Dayton

    You could write a fairly simple class that would act as a
    wrapper for the sound class. In this class you would let it define
    the 2 sound objects but then you would only need to use call to the
    class object to control both. This could also be expanded to
    control more than 2 sounds. It is not exactly what you were hoping
    for but in the long term it would simplify sound control and be
    reusable in pretty much any setting that required sound.
    Tim

  • Effect Controls Timeline keeps zooming out

    So I'm currently working on a tutorial video that involves a lot of stopping and starting.  I'm loving Premiere's method of creating freeze frames (drop a keyframe in the Effect Controls timeline where you want it to freeze, option+cmd+drag it to the point where you want it to resume) however every time I do it, the Effect Controls timeline zooms out to show the entire project.  This is frustrating as I need to re-zoom in every time I want to freeze it; does anyone know a way around this?

    Ok, so here's a more detailed description.  The way I know to freeze a frame is to drop a speed keyframe (which has a left and a right half), and to then hold down Option+Command and drag the right half of the keyframe to where you want it to stop freezing.  This usually relies on zooming in to the Effect Controls timeline since I'm only freezing for a few seconds at a time; but the problem is as soon as I let go of the mouse to drop the end of the keyframe, the timeline snaps back to full view.

  • Kde control center sound i/o method

    I just installed arch 0.5, and had some problems getting ALSA set up.  After reading through this forum and several others, I managed to get it set up properly (I think). 
    However, when I go to the KDE control center>>sound>>sound i/o, I don't see an option for ALSA.  When I had Mandrake 9.1 installed, it was there.
    Do I have to do something special to get the ALSA option to show up?  Do others out there running Arch have that option?  I added the alsa drivers to modules.conf and do see them when I run lsmod.  Is there something else I need to do to use alsa in KDE?
    Thanks!

    no i dont think so ... my modules.conf-sound-part looks like this:
    #### SOUND #####
    # the specific part:
    snd_index=0
    options snd snd_cards_limit=1 snd_major=116
    alias snd-card-0 i810_audio
    # and some things for the general sound support:
    alias sound-slot-0 snd-card-0
    alias sound-service-0-0 snd-mixer-oss
    alias sound-service-0-1 snd-seq-oss
    alias sound-service-0-3 snd-pcm-oss
    alias sound-service-0-8 snd-seq-oss
    alias sound-service-0-11 snd-mixer-oss
    alias sound-service-0-12 snd-pcm-oss
    i'm using the "i810_audio" module, as oyu can see ... and with this OSS works for me --- adapt this for you --- and in the KDE-aRTs-dialog(the one in the control center) just select "Autodetect"
    -> one more thing: be sure you have access to /dev/dsp (either chmod in /eth/rc.local or make a usergroup sound that owns it)

  • Help my nav controls my sound

    I am building a site and i have one section for lights with
    on and off buttons that works fine. I have a sound section with on
    and off buttons that work fine. The problem I have is if the sound
    is off and I hit say the navigation home button then my sound
    starts up again. Its the only nav button i have coded so far but i
    believe if i finished it the others would do the same thing. I have
    tried every tutorial i can find and the code is either wrong, or i
    get the funny button problems were other buttons cause the sound to
    restart. All i want is the site to load with the music playing, but
    if the user turns it off, it should stay off regardless of the
    scene they go to unless they decide to turn it back on. So what am
    i missiong here, why won't only the sound buttons control the
    sound. I tried loading the sound and unloading it, including it on
    a time line, and in a button, but everything has the same problem,
    other buttons such as the nav turn the sound back on. i am
    uploading my flash file hopefully someone can suggest something i
    am missing and suggest something better.
    my file is at www.designbytreitner.com/main2.fla

    Like I said, I’ve tried several tutorials and methods
    and they all wind up with the same bad side effect. Of course all
    methods use scripting, how else would you get anything to work.
    What do you mean post my code here that would be fine if the
    problem could only be my sound buttons. However it could be
    something else as well, that’s why I gave a link to my flash
    file instead. Also I mentioned trying several different methods
    which all had the same problem with other buttons re-starting my
    sound. That tells me the problem is something other than the code
    on my sound buttons.

  • Can I control the sound on users computer

    Hi
    I have a high school lab with 25 new intel iMacs. Is it possible to control the sound on the user computer so they can not use it. I have Mac server 4.10.10 and Apple Remote 3.0, etc. Any help would be appreciated.
    Perry

    Assuming you can't reset this by removing or locking the particular Sound settings in System Preferences via Workgroup Manager (WGM), then take a look at:
    http://discussions.apple.com/thread.jspa?threadID=1141459
    It's not exactly the same, but it might well point you at a solution.
    If you're just getting going with Macs in this particular environment, then you'll likely come to realize the Workgroup Manager and Server Admin tools are going to be your BFFs.

  • Control flash sound level

    Hi,
    is it possible to control the sound level of the flash player from Windows Volume Mixer and have it permanently stay on the level I set? I'm using Windows 8.1. After every playback on Youtube, the sound level resets to the maximum level.
    Thanks.

    Hi alv93,
    Yes, however the volume mixer does not sync with the volume slider on the flash plug in unfortunately.

  • Need help playing sound via AS3

    Hi all,
    First time I have tried playing a sound through AS3. I found an example from kirupa, but for whatever reason I can not get it to play the sound. I'm not getting any errors etc, and I have my .wav file inside the same directory as my .fla/.swf I have tried playing from inside the flash pro interface and from a personal webpage server.
    Is there something that I am missing? I just have a action layer with the below code inside the first from of the movie.
    var soundClip:Sound;
    function init() {
    soundClip = new Sound();
    soundClip.load(new URLRequest("mysound.wav"));
    soundClip.addEventListener(Event.COMPLETE, soundLoaded);
    soundClip.addEventListener(ProgressEvent.PROGRESS, soundLoading);
    init();
    function soundLoaded(e:Event) {
    soundClip.play();
    function soundLoading(e:ProgressEvent) {
    // preloader information goes here
    Any help would be great

    thanks for that kglad that solved that problem. what I am trying to do is play the sound 1 time for a session only. I'll have multiple pages that use the same .swf, I just want the sound to play 1 time when the user first visits and then not to play for all other requests.
    This is an example I found, to you does it look right? I'm not getting any errors, but I'm not getting the sound to play either.
    import flash.net.SharedObject
    //Use anything in place of "sounds"
    var so:SharedObject = SharedObject.getLocal("sounds");
    //Check if the sound has not been played
    //Use anything in place of "specificSoundPlayed"
    if(so.data.specificSoundPlayed == false)
    //Play the sound
    var snd:Sound = new Sound();
    snd.load(new URLRequest("my.mp3"));
    snd.play();
    //Set the shared object property so we know the sound was played
    so.data.specificSoundPlayed = true;

  • Controlling 2 Sounds independently?

    Hello -
    Does anyone know if it is possible to controll 2 independent
    sounds playing at the same time? I am working with a voice-over
    testimonial and background music. I am only able to control both
    sounds globally to adjust volume. I have tried every action script
    approach I can think of to do it. I would love to hear any
    suggestions, ideas, etc.
    Thanks in advance!!
    Nevin

    Nevin,
    > Thanks kglad - I did try the separate movie clips and
    yes
    > you can invoke sounds seprarately that way - I still am
    > unable to control the volume independently.
    kglad and I are giving you the same advice. As long as you
    use
    independent movie clips to associate with each Sound
    instance, you'll be
    able to adjust the volume of each Sound instance separately.
    > Here is the volume code I tried after setting the new
    sound
    > parameters in the first few frames:
    >
    > bgmusic.setVolume(25);
    > voicover.setVolume(75);
    Did you first instantiate these Sound object like this?
    var bgmusic:Sound = new Sound(someMovieClipInstanceA);
    var voiceover:Sound = new Sound(someMovieClipInstanceB);
    If so, adjusting the volume or pan of either one later would
    only affect
    the Sound instance referenced. ActionScript 3.0 handles this
    in a different
    way, using companion classes SoundChannel and SoundTransform.
    In AS2, the
    sound channel concept is still there, only it occurs by way
    of the
    non-obvious mechanism of movie clips acting as the sound
    channels.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

Maybe you are looking for

  • I upgraded my iphone4 to a iphone 5 and lost my icloud storage and most of my data  Why

    I recently purchased 20Gig of Icloud storage. I upgraded my iphone from a iphone4 to a iphone5. Before copy the APPs and data to my new phone. I backedup my Iphone4 using ITUNES to both my computer and the icloud. When I try to restore it to my iphon

  • How to transport a simple BEX query ?

    Hi guys We have a new BI system. And i am trying to transport a Query from DEV to QA. I believe transporting query is slightly different from transporting other BI Objects like cube DTP etc.. Can some one tell me how to do this? right now i goto the

  • TV@nywhere Master and TVR software

    After a search, I found that Stu had posted in a seperate thread as follows: Quote from: Stu on 24-September-06, 22:06:08 i recommend trying out the TVR software (from the TV@nywhere Plus page) As I had posted earlier in a separate thread https://for

  • Drop off wifi connection more frequently after update to iOS 5.1

    After the system updated to iOS 5.1, the wifi connection on my iPhone 4S drops off more freqently than before. For example, when I updated Galaxy on Fire 2,  the wifi lost connection about 5 times. But the connection on my Android tablet and laptop i

  • El exe de captivate no reproduce animaciones edge

    Las animacionesEdge importadas directamente a Captivate 8 no se reproducen en los ejecutables. Hice una animación con botones y un audio y sale en blanco el lugar de la animación. ¿Alguien sabe por qué?