Stop embedded sound playing before clip starts

Hi,
When I test my app on a device the sound starts playing before the movieclip.  The sound is embedded in an external swf.  I can access the sound using:
SoundMixer.soundTransform = new SoundTransform(0);
But I can't work out where to turn it back to 1 so it starts when the movie starts.  The code I'm currently using is below, but the sound still starts before the clip does.
Thanks.
private function startMovieOne(event:MouseEvent):void
            var defaultSWF:URLRequest = new URLRequest("movieOne.swf");
            loader.load(defaultSWF);
            loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
            loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
        private function onInit(evt:Event):void
            loader.contentLoaderInfo.removeEventListener(Event.INIT, onInit);
            SoundMixer.soundTransform = new SoundTransform(0);       
        private function showProgress(evt:ProgressEvent):void
            loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, showProgress);
            var loadProgress_percent:Number = Math.floor((evt.bytesLoaded * 100) / (evt.bytesTotal));
            trace("loadProgress_percent: " + loadProgress_percent);
        private function onComplete(evt:Event):void
            movieTwo_mc.addChild(loader);
            trace("loaded");
            loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete);
            SoundMixer.soundTransform = new SoundTransform(1);

i assume the sound is attached to a movieclip timeline (otherwise, use the sound reference).  movieclip's have a soundTransform property that you can use to control their sound.  you should be using that instead of the global SoundMixer soundTransform unless you have more than 1 sound and you want to control them all concurrently.
and, you use the soundTransform like this:
var st:SoundTransform=your_mc.soundTransform;  // though, you could continue to use the less desireable, var st:SoundTransform=SoundMixer.soundTransfom;
st.volume=1;
your_mc.soundTransform=st;  // again, if you continued using the global SoundMixer soundtransform, this would be:  SoundMixer.soundTransform=st;

Similar Messages

  • Intro clip plays before menu starts, but has a few frames of black. I need it to be seemless, please help!?!?

    Hello,
    So Im in Encore 6. I have a timeline with video and audio selected with first play, so it plays as an intro before the main menu.
    The intro clip connects to the menu, however there are a few black frames during the transition to the main menu and I need this to be seamless.
    Any help would be greatly appreciated.

    You won't know until you play from a disk whether it is seamless or not. The Encore preview is not reliable.

  • What stops Swiffy sound playing in mobiles?

    Dear all
    I have converted some Flash animations-with-sound to Swiffy, so I can offer visitors both SWF and HTML versions.
    For those who don't know (because there's not much around about Swiffy), it's a Google tool that converts an SWF to a JSON object embedded in HTML, then a Google runtime.js interprets the file when loaded (I think).
    The animations are good, comparable to my Flash versions.
    The problem is sound - on desktop PCs, I get full sound in Windows in the top browsers (FF, IE, Chrome).
    But there is no sound on Android and Apple iOS mobiles. Please test: http://www.casedasole.it/testing/swiffy.html
    One explanation might be that - at least in the case of iPads, but I've read also for Android - a user action is needed to load the audio, supposedly to let the user decide  whether or not to download a big file. 
    But,... the audio in Swiffy files is embedded in the HTML (look for "data:audio/mpeg;base64, ........" in the code of the sample page above).
    So, there really is no audio file to load, it's loaded with the Swiffy file, encoded in base64.
    Does anyone know why exactly mobiles don't just play the sound?
    thanks in advance
    TT
    PS: If this is off-topic, apologies. Everywhere I take this question (apple forums, android forums, stackoverflow), it's been marked as off-topic.

    Squall867 wrote:
    Problem is that I'm not familiar at all with these API,and I don't have much time to read the entire tutorial so I just need a simple code doing the job(with commented lines of curse..I'd like at least to know what I'm doing).And you apparently don't have time to google for it either?
    [http://lmgtfy.com/?q=JAVA+MIDI+examples&l=1]

  • How to stop sound playing at a embed FLV video

    Hello,
    I would not a piece of code, which will stop the sound
    playing in a embed
    flv video. Following situation:
    I have a "main.swf" file which loads two swf as following:
    loadMovie ("Teenies.swf", _root.contenedor);
    loadMovie ("CananIntro.swf", _root.mc_video);
    The "CananIntro.swf" includes (embed) the flv video "canan
    PART1.flv".
    I would need the action sript code to make the sound at
    "canan PART1.flv" ON
    or OFF.
    Thank you for any hint.
    Walter

    Another way to do this is to create a boolean right off the start. Lets say var createMusicTrack:Boolean and set it to true
    Then load your music and start playing it and at the end of that load code add a line that sets the boolean to false so that when you come back to frame 1 the boolean will be false and the code will not load and play, but this could be problematic too. Djnr suggestion is better for your purposes.

  • If you have music playing when you start moving your library to a different

    ...HD, then you're stuck listening to that music until the consolidation is done.
    just a heads-up, I guess. I'm listening to stuff I'd rather not be listening to now because it's got maybe a half-hour to go before it's done moving my library.

    Yeah, I'm sure you're right. That's probably why it's like that.
    I just wish I'd picked different music to play or stopped playing before I started moving the library.
    Well, it just hit Canned Heat. So I can deal with that for a while.

  • How to start and stop an embedded sound

    I'm putting a sound of a cat purring in the intro to my animation. I've been asked to make it possible for viewers to turn the sound on and off with buttons. I can do it with an outside sound file by using URLRequest.
    Is there a way to start and stop the sound if it is embedded in my library? If so, can someone give me that script.
    TIA

    Hello mnemo,
    You can use your digital signal to stop your generation with the following property node
    DAQmx-Triggering
    Regards.
    Jean-Baptiste C.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Téléchargez dès maintenant toutes les présentations techniques !

  • In Logic Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    In Logic, Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    Curious if what your describing is similar to issue 4 which starts around 9:15 in video...
    https://youtu.be/q93jdOhi4Oc
    If so this started for me, or at least I noticed it for the first time in LPX 10.1.1. What version of logic are you running?
    I've recently found that this issue also affects note timing on instrument tracks that use the "External Instrument" plugin.

  • When i login to my account and it takes me to the desktop, the error sound plays, then the rainbow wheel appears, and finder immediately stops responding

    It started yesterday when i was listening to itunes when all of a sudden the music stopped playing and i had to hold down the power button to shut it down and reboot, and then, when i logged back in, the error sound played, and then finder opened up, but the window was grayed out like i had another app selected, bu i didn't, so i tried to open up itunes and the icon started bouncing and then it stopped midbounce and i had to reboot again because finder wasnt responding. now when i log in, the error sound plays, and finder immediately stops working and then i have to reboot again because i cant click anything and i cant properly relaunch finder. please help

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • No embedded video (empty bar) in FF ver. 15 32bit. Sound plays. Flash ver. 11.4.402.265. No problems in IE. Windows 7 x64.

    Installed FF 15 (32 bit) on a fresh copy of Windows 7 Ultimate edition (x64).
    Everything works fine except the embedded video.
    The video clip thumbnail is shown, when clicking on the clip the sound plays and the right-mouse click shows flash player options, but no video is shown (empty bar).
    No problems on original YouTube or other flash video sites were detected.
    No crashes detected.
    Please, advise.

    1) Started the FF in Safe Mode.
    The embedded video works normally (!!!)
    2) Re-started the FF in normal mode - got the problem.
    3) Disabled ALL plugins and ALL add-ons (except the flash player) in Normal Mode - got the problem (once again, ALL plugins / add-ons were disabled).
    Safe Mode - everything works.
    Normal Mode - problem occurs (with no relation to disabling plugins / add-ons).
    Looks like there's something built-in FF which has the problem with showing embedded video normally in FF Normal Mode.

  • Stopping a currently playing sound?

    I will try to make this quick and painless and hopefully
    someone knows a solutions...
    I am making a kiosk based on another designers layout where I
    work... I am not going to get in the details, but the work seems
    sort of an unorthadox way of using flash - anyways...
    It is basically an interactive slide show... play, pause,
    previous slide, next slide...
    Each SWF that is loaded in is around 15000 frames in lenght
    (right under that magical 16000 number) - the audio voice overs are
    on the time line one after another... so when the slide changes the
    voice over matches the slide current slide... there are 31 slide
    JPGs and 31 mp3 files that are divided between 8 SWFs.
    The issue I am having is that when you are one the first
    "SWF" (slides 1-5)... and you move from slide 1 to 2 before the
    audio is done playing... it will keep playing the audio from slide
    one and then start the audio from slide to ... so on and so forth
    until you get to slide 6 - which is a new SWF that is loaded...
    I know that I need to use a stop sound script somehow... on
    the first frame of each of the following slides so that it stops
    the currently playing sound... if it hasn't already finished...
    if you let the presentation go it works fine... but when you
    move forward and back... the sound gets garbled....
    can someone please help me rig this to stop the currently
    playinh sound when you advance to the next slide...
    I know this is a horrible way of doing this... I would have
    loaded averything in at the begining and called it when needed...
    but to go into details of why I had to do it this way would be too
    long... let's just say the client is always right...

    I'd use:
    var snd:Sound = new Sound();
    snd.attachSound("likageID");
    snd.start();
    It looks like you attempt to attach the sound to the
    movieClip instead
    of the soundObject which won't work.
    HTH,
    Manno
    DigitalElemental wrote:
    > Ok I am trying to get the sound off of the time line...
    i have a feeling the
    > way this other guy did it is going to put me in a world
    of pain...
    >
    > I put this code at the begingin:
    >
    > var snd:Sound = new Sound();
    > slide001.attachSound("slide001");
    > slide002.attachSound("slide002");
    > slide003.attachSound("slide003");
    > slide004.attachSound("slide004");
    > slide005.attachSound("slide005");
    > slide006.attachSound("slide006");
    > slide007.attachSound("slide007");
    > slide008.attachSound("slide008");
    >
    > then I try calling the sound to start at the specified
    frame I need it with:
    >
    > slide001.start()
    >
    > I can't get the sound to play though... can someone tell
    me what I am doing
    > wrong here? I have set the linkage for all the sound
    files...
    >
    > Thanks
    >
    Manno Bult
    http://www.aloft.nl

  • Stop sound when another sound plays

    Hey guys,
    Using Flash Pro CC 2014, Actionscript 3
    I am working on a soundboard and use buttons that play sounds, and I want to make it that when a new sound plays, it automatically stops the current sound from playing, that way 2 sounds dont play at same time.
    But I also have a button that stops all sounds, I am using the "Click to Stop All Sounds" code under Audio and Video in the Code Snippets.
    So I am basically wanting to make sure I can do both, keep the stop all sounds button, but also have it when you press any sound button, it stops all sounds and starts playing the current button/sound. Any suggestions?
    BTW I am setting up symbols as buttons, not movie clips incase you need to know for coding, but I can switch to movie clips if its easier. I was just used to buttons on older versions of Flash for simple stuff like this.
    Thanks.

    Thanks for the reply, I am new to actionscript 3 but am a fast learner. Maybe I am doing this wrong, but when I add the code it simply stops the sounds, but it wont play the sound from the button that I just clicked on. I want it to play the sound button clicked on, and also stop any other sounds that are currently playing.
    For Flash 8, as2, I would add this to the button:
    on (press)
        stopAllSounds ();
    On as3, does it need to say this?
    button_2.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds);
    function fl_ClickToStopAllSounds(event:MouseEvent):void
        SoundMixer.stopAll();
    thanks for your help

  • I have a site with m4v files that played before the upgrade to 10.6.7, now just sound

    I have a site with m4v files that played before the upgrade to 10.6.7, now when accessed the sound plays but no video. Is there a different file type I should create or is this a glitch w/this version? Played before & still plays-Mac b4UG-PC/Iphone/Ipad.
    Page Link: http://www.myfarrah.com/My_Farrah_Actress.php
    You can click the video link to play or...
    Video Link: http://www.myfarrah.com/ACT7.php
    Code:
    <table width="444px" border="0" cellpadding="0" align="left"><object width="444" height="285" border="0"><param name="movie" value="http://www.myfarrah.com/bbed/bb2.m4v"></param><embed src="http://www.myfarrah.com/bbed/bb2.m4v" type="application/movie" width="444" height="285" border="0"></embed></object><p>   

    Are you using Safari or Firefox? It runs as expected in Firefox, but in Safari I too get just the sound, and going to the m4v link causes the movie to download rather than play (it downloads fine and plays in Quicktime once downloaded). I checked some of my own m4v movies, and they were playing fine in Safari. For one embedded in a complex web page, see here:
    http://www.pinkmutant.com/articles/snowleo.html
    The next m4v has its very own very simple page, with the movie called using an embed tag with various options set (you can see the details by going to View->View Source)  and also plays:
    http://homepage.mac.com/francines/Movies/duomo.html
    There was a problem with a Safari plug-in misbehaving very early in Snow Leopard, but I no longer remember the details. But see this archived discussion:
    https://discussions.apple.com/thread/2158092?start=0&tstart=0
    It was a rather complex problem, but I had thought one of the updates fixed it.
    Francine

  • How stop ambient sound when video sound starts?

    I play ambient background music in my movie. I've written
    Actionscript to attach an mp3 and control the overall sound volume.
    The code to control the overall sound is:
    _global.allSounds = new Sound ();
    _global.allSounds.setVolume(50); for example
    However, in my movie there are also video clips (w/sound)
    that I have embedded using the FLVPlayback component and one of the
    designer skins. The problem? I don't know how to stop the ambient
    music when the user clicks the "Play" button on the skin. Both the
    ambient sound and video sound play at the same time creating a
    cacophony. And if the user happens to click the "mute" button on
    the skin, my _global.allSounds.setVolume() commands have no effect.
    How do I integrate the way sound is controlled by
    Actionscript vs. the way it is controlled by video components?
    Thanks.

    The obvious answer would be: remove the Beep VI that's probably in there. Please show us your code.

  • Lag after pre-loader hits 60% and before movie starts playing.

    Hi all,
    I’m hoping somebody can shed some light on an issue
    that I’m experiencing with a Captivate project I’m
    working on. I’ll try to explain this in detail so you
    understand the background and scope of this project. These are
    being exported as HTML/SWF and being viewed within IE6.
    I’ve been tasked with taking a new employee training
    course that is currently handled by a live person standing in front
    of a room of people and showing them an 18 minute VHS tape and also
    covering information that is presented on a PowerPoint file, and
    making it into a Captivate movie.
    I was able to get the original digital video cut into 4
    chunks and converted to SWF by media group that produced the tape.
    The four SWF files are 320x240 and range from 13 to 22 megs.
    Because of the size of the files and the amount of content, I
    created 8 ‘modules’ that make up the larger project.
    The last slide of the first module launches the 2nd module, etc.
    until the user has seen all of the modules which on their side
    (other than a brief pre-loader popping up at times) is mostly
    transparent and they think they are just watching a 30 minute
    training course.
    Basically, what I’ve done is laid out the modules so
    that the whole course alternates back and forth between text slides
    with voice-overs and the movie clips. The movie clip SWF’s
    have been embedded into every other module, so:
    Module 1: Intro to the course (text & voice-overs)
    Module 2: Video clip 1
    Module 3: Discussion about stuff (text & voice-overs)
    Module 4: Video clip 2
    Module 5: Discussion about stuff (text & voice-overs)
    Module 6: Video clip 3
    Module 7: Discussion about stuff (text & voice-overs)
    Module 8: Video clip 4 and wrap-up
    Now here is the problem:
    We have 20+ offices and I am located at the main office where
    the web servers are located. If I run through this, everything
    works great. I tested this in one of our off-site locations today
    where they have a semi-fast connection, but still going across a
    WAN.
    Module 1 loads fine. Hits 60%, plays, user can click Next,
    Next, Next to proceed through the training. At the end of Module 1,
    we prompt them with some text to let them know there may be a brief
    delay before they see the upcoming video clip. Click Next, loads
    Module2.swf which has the videoclip1.swf embedded in it (21 megs).
    Takes a little while to load which is expected. Hits 60%.
    Preloader goes away and then just white screen for at least 10
    seconds (sometimes 20-30 seconds, depending on the size of the
    embedded movie clip) before the movie actually starts playing.
    This is not acceptable as the user will think that something is
    broken. If the movie is not completely loaded, then it
    shouldn’t have hit 60% and the preloader graphic disappear,
    right?
    I think that the problem revolves around the movie clip not
    being able to play until it is fully loaded, although the Module
    has loaded the 60% that it needs to begin playing. The only way
    around this that I see is re-arrange my slides so that the video
    clip is not the first slide to play in any given module.
    We tried this on at least 7 computers, all of which were just
    rolled out new last fall, so the machines are definitely beefy
    enough to handle this.
    Any ideas?
    Thanks,
    Mike

    quote:
    Originally posted by:
    CatBandit
    I just read your title, Mike (I don't have time for the whole
    article - sorry), but felt it might help to point out that 60% is
    40% less than 100%.
    Nope, I am not being a wise guy, but I know it's possible to
    have so much "weight" in the content of the last 40% that
    additional delay might be required while a (early) required element
    or object completes down-streaming. Just a thought...
    Hi Larry,
    Good to see you back on the forums and thanks for the reply.
    What you posted further proves my point. From what I've been taught
    about Captivate, it loads to 60% and begins to play while the
    remaining 40% loads. Not loads to 60% and then some portion of the
    remaining 40% may or may not have to load before it starts. If
    that's the case, why not just load 100% before it starts and then
    have no problems?
    It shouldn't matter how large the file is, right? The only
    difference is that larger files would take longer to reach the 60%
    mark. 60% is 60% is 60%. Compare a feather to a car. 60% of the
    weight of each item is still 60%, it doesn't matter how much it
    weighs.
    60% of a cubic foot of rock is the same percentage
    as 60% of a cubic foot of marshmallows.
    Anyway, I think the solution here is to fudge the problem by
    putting a few 'less weighty' slides in front of the slide with the
    embedded video so that the user has something to look at other than
    a blank screen. I was just hoping somebody else might have
    experience this and had a magic button I could press to make it all
    better.
    I could handle this if the preloader continued running so the
    user had some clue that it was still working, but when the
    preloader hits 60% and disappears and then nothing happens for
    another 10-20 seconds, that's a problem.

  • I no longer have sound when playing my clips through adobe premiere elements 12. How to I correct this problem? I have checked all audio levels and there is no mute on etc. I have updated to 12.1. Still no sound.

    I no longer have sound when playing my clips through adobe premiere elements 12. How to I correct this problem? I have checked all audio levels and there is no mute on etc. I updated to 12.1, but still no sound in any clips. Even not on old files which used to work.

    bfun
    What computer operating system is your Premiere Elements 12/12.1 running on? Can we assume that this audio plays back OK
    on the same computer when you are using a computer player independent of Premiere Elements?
    What are the properties of these clips that worked before but do not know with regard to sound
    For now, I will assume that you are working on Windows 7, 8, or 8.1 64 bit.
    Have you checked the Edit Menu/Preferences/Audio Hardware ASIO settings? Do you have any 3rd party audio devices incorporated in your computer environment?
    Please delete the Adobe Premiere Elements Prefs file and, if that does not work, then the whole 12.0 Folder in which the Adobe Premiere Elements Prefs file exists. The Windows 7, 8, or 8.1 64 bit path is
    Local Disk C
    Users
    Owner
    AppData
    Roaming
    Adobe
    Premiere Elements
    12.0
    and, in the 12.0 Folder, is the Adobe Premiere Elements Prefs file that you delete. If that does not work, then delete the whole 12.0 Folder in which the Adobe Premiere Elements Prefs file exists. Make sure that you are working with Folder Option "Show Hidden Files, Folders, and Drives" active so that you can see the complete path cited.
    Do you have installation files or installation disc with the purchased serial number in case we need to resort to uninstall/reinstall?
    We will be watching for your follow up.
    ATR

Maybe you are looking for

  • Multiple additional SIP domains - certificate and DNS requirements

    We've setup Lync 2010 Enterprise in our organisation and have successfully enabled a couple of thousand users. This is working successfully internally, externally and through Lync Mobile. However, we've only enabled users who are using the main compa

  • Slow access to files that are already being opened by another user

    HI, A client has a Windows 2008 server setup with Windows 7 workstations.  When a user opens a document (docx, xlsx etc) on the server it opens without an issues.  If a second user tries to open the same file that the first user is in, the second use

  • How do I control the quality of JPEG images?

    I've written a program that scales a set of JPEG images down to various dimensions. I'm happy with the speed of execution, but quality of the images could be better. How do I specify the quality of the JPEG images I create? In graphics editors, I'm g

  • Two finger swipe has gone wrong.

    I was messing with the two finger swipe in safari where you swipe back and forth for the forward page and backward page with the cool animation. Everything was fine until i found out that this can not be done in Google Chrome or Firefox. So I decided

  • Prnt prgm for smart form

    hi,      i am doing smart for display contract.this is the form name "RE_CN_020".can u pls help in finding out the prnt prgm for that form.i have also searched in tnapr table but couldnt find any.i have found soem prgm name " RFRECPSFA420".but when i