AS3 stopping audio streaming inside a layer

Sometimes I get ahead of myself and have to stop and say how the hell did I do this before? I'm referring to a simple stop button I need to put in a flash animation. I know how to code calling a sound from the library, starting and stopping. But how do I stop audio that is streaming inside a layer from a button ?
var my_sound:Sound = new Sound();
my_sound.load(new URLRequest("yoursoundfile.mp3"));
var my_channel:SoundChannel = new SoundChannel();
//2.
play_btn.addEventListener(MouseEvent.CLICK, playSound);
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
//3.
function playSound(event:MouseEvent):void{
my_channel = my_sound.play();
//4.
function stopSound(event:MouseEvent):void{
my_channel.stop();

OK what I actually need is a mute and play button for the audio track
So how can I stop, or in this case mute the audio without stopping the animation, follow?
example, volume is at 100
click button volume goes to 0
click same button or another button volume goes back to 100

Similar Messages

  • AirPlay stop audio streaming closing iPad control app

    Just bought AirPort Express.
    Wifi connected to my NAS, used to stream music to my old stereo that is in another room using analogic audio out.
    Opening iPad control app I can select and play music, but when I close the app (not leaving in background, closing down or shutting down iPad) the audio stream stop.
    In the control app (DS Audio from Synology) I also can't select AirPort Express as player in settings, only iPad is listed. I can correctly select AirPort for AirPlay.
    NAS firewall is configured to allow AirPlay, AirPort firmware is latest release, I use iPad 2 with iOS 6.01.
    Any suggestion?

    also i want to specify something............if am using loopback address,the sender and receiver(in this typical code,capture and receive files) ought to have diff. ports( i suppose as their ips are already same)
    or am i wrong???
    i have given same ports.......i had tried once with diff. ports........miraculously perhaps it worked (the sound was echoed through my headphone),....but next time when i tried i failed......and still failing........any suggestions please waiting eagerly

  • Streaming audio from my IPAD to my Apple TV from Rhapsody application.  when Apple TV go into Screen Saver mode, about 5 minutes after that it stops playing the Audio Stream and goes into Sleep mode.

    I am Streaming audio from my IPAD to my Apple TV from Rhapsody application.  when Apple TV go into Screen Saver mode, about 5 minutes after that it stops playing the Audio Stream and goes into Sleep mode.  I am using the Optical Out from the Apple TV to my receiver, the Apple TV is hard Wired to the Network, the IPAD is Wirelessly attached to the network (it continues to play the Audio Stream).  When the Apple TV is turned back on it resumes playing once I manual select it for output from the IPAD.  All device are on current releases of software.  I have no Video hooked up to the Apple TV.  How do I correct this?

    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.

  • Audio streaming stops after about 13 minutes.

    Audio streaming over the Internet just stops after about 13 minutes and has to be restarted. I need a solution

    Thanks for your help! You helped solve the issue, albeit indirectly...
    At this point, I want to share my experience, in the hope that it might be helpful to others:
    After finding that chapter markers had nothing to do with the problem, I found that indeed my camcorder was set to the dreaded 12 bit. Oh dear! The original DV tape is long gone. (At first I did not expect this to be a problem, since I had made several DVDs successfully with the existing settings, but then there are all these horror stories in discussions about what 12 bit can do to you.)
    So to rescue my movie, I found advice to "share" my iMovie back to a fresh DV tape, and then re-import it with the 16 bit setting.
    This lead to the next issue: After a number of minutes of re-exporting to DV tape, the video received by the camcorder would freeze, while the audio continued. This happened at several different points in several differerent attempts.
    So next I visited iMovie discussions, where I found advice to clean up my Mac. I used Mac Sweeper, and now indeed my Mac runs faster and smoother for many apps. I also downgraded my QuickTime version. But another attempt of exporting from iMovie to DV tape also failed, but now it failed at exactly the same point where the audio stopped in my DVD!!! (Even though on the export-to-DV-tape it was not the audio but the video that froze.)
    Next I found that when playing that problematic scene in iMovie, the iMovie program would also freeze at that very point, making it necessary to "force quit" out.
    In the end the solution was to chop out the problematic bit in that scene. Now everything works fine, including the iDVD step.

  • Audio stream stops when I switch to another tab in Safari

    I've got this radio station website which links to a live stream so you can hear the station online. It worked fine a couple of weeks ago, on my Powerbook G4 running 10.4.9. Then my Powerbook died.
    Enter my new MacBook Pro, still running 10.4.9. I try to listen to the same station, but everytime I start the stream, then switch to another tab to browse the internet, the audio stream stops.
    BTW, the audio stream behaves properly when I use Firefox. Is there a reason why Safari can't keep on playing the audio stream when it's not in the active tab? Or have I got a bad configuration?
    Many thanks, as always.

    Nah, forget it; I just remembered what really used to happen (which still happens):
    I used to open a new Safari window (not a new tab), open the radio stream in that new window, then switch to my previous Safari window with all my tabs. Then it works.
    For some reason, I don't have to do this (i.e. open two different windows as opposed to two tabs) in Firefox.
    I really like and prefer Safari to most browsers, but I have to admit, it's rather flaky in a number of ways. This is one of them.

  • AS3 Audio Stream

    I'm trying to find a way to capture an audio stream from the
    microphone instead of having to send it to FMS. Anyone have any
    idea how this can be done? I don't care what format the audio gets
    stored in as long as I can play it back. I might store it in memory
    and I might save it to the hard drive using AIR. Some folks have
    figured out how to do this for video with the AS3 PNG encoder so
    I'm sure there's a way to do it.
    Could this be done by hacking the NetStream class somehow?
    To any Adobe folks listening in, Flash could really use video
    and audio encoding classes! I argh every day that it doesn't.
    Thanks.
    Mark

    The flv capture that I mentioned can be found here...
    http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs

  • Ipad audio stream stops

    I've had the ipad (new) since April 2012. The problem arose not long after the purchase and doesn't seem to be getting any better, no surprise! The problem being, audio stream stops. Sometimes the stream can be restarted by nothing more than opening up the audio steam homepage, or sometimes starting a different audio file within the homepage and then click back to the original stream, all the way to turning the ipad off and restarting...and even this has mixed results. At times even using all of the aforementioned has mixed results with varying intervals lasting anywhere from 30 seconds to 15 minutes, then at times can last for hours. I've double checked the problem comparing simultaneously with my laptop and it appears the problem is ipad only. There are numerous online posts concerning this but haven't yet found a solution to the problem.
    Thanks to anyone helping with the resolve!

    Nah, forget it; I just remembered what really used to happen (which still happens):
    I used to open a new Safari window (not a new tab), open the radio stream in that new window, then switch to my previous Safari window with all my tabs. Then it works.
    For some reason, I don't have to do this (i.e. open two different windows as opposed to two tabs) in Firefox.
    I really like and prefer Safari to most browsers, but I have to admit, it's rather flaky in a number of ways. This is one of them.

  • Compressor stops working at audio stream

    I've been having some Compressor problems, which I think I have narrowed down, at least in this one instance to a corrupt audio file. I submitted an hour long self contained QT movie 2 nights ago, and it successfully encoded the MPEG 2 file, but stopped when it came to the ac3 file. I de & re-installed Compressor from the original FCP 2 discs, so I'm now running 3.0, on OS 10.4.11, on a G5 dual 1.8 machine.
    So last night I submitted the same QT movie that had stopped compressing the night before, and it did the same thing again- successfully encoded the video stream, but NOT the audio. Compressor stopped working in exactly in the same place as it did the night before. This morning I used Jon Chappell's app Compressor Repair, and am up and running again, compressing another movie that seems to be working just fine.
    But, I still have the problem with the particular movie with bad audio file. From another forum, someone had a similiar problem 3 years ago with a corrupted audio file. Which I think is what my problem is now, for at least one video I'm trying to encode.
    So the questions are: How do you find the corrupted file, what do you do? How can I encode the audio stream for this file?
    Of course I have a deadline for Monday, so any suggestions are most welcomed!
    Thanks very much
    Melinda

    Try exporting a self contained QT movie which only includes the audio from your sequence. Set it to be "current settings"... will then match your sequence settings. If it exports OK, just put this file in the sequence for compression.
    Micheal's solution is much the same actually as mine... When you use the sequence settings, the QT is nothing more than a QT movie wrap around the aiff.
    QT is a container for media files of any kind actually.
    Jerry
    Message was edited by: Jerry Hofmann
    Message was edited by: Jerry Hofmann

  • Pen tool: Resize image inside a layer/ stop pen outline / white space after crop

    I have 3 noob questions all related to the pen tool.
    1. Whenever I use the pen to outline something and drag the image to another psd file I see a grey pen outline around the image.
    ex. http://screencast.com/t/GmKWAr5UH
    2. Whenever I outline with the pen and then select inverse and then delete the background, the background becomes white. I want to drag my outline into my new file but without a white background. it should be transparent so it appears like a collage.
    ex. http://screencast.com/t/Rh4Uvq4xBM
    3. how do I select an image inside a layer to resize it. Nothing I do creates handles around the image isnide the layer.

    Theres some basic stuff you are not understanding…
    1. In Photoshop there is the pen tool for creating abstract vector edges, and selection tools (lasso, magic wand etc). You need to turn the results of the pen tool into a selection. Best way is using the the Command/return shortcut, or command clicking on the path in the paths panel.
    2 layers need to be , not - If you want to delete areas (make them transparent). To do this either go to Layer/New/Layer from background - or hold Option and double click the Background layer.
    3 See answer 2, and use Free Transform (command T)

  • Flash CS3 Play/Stop audio button problem

    I made a play/stop audio button with this youtube tutorial (youtube.com/watch?v=XU6oMEFUFF8) but after the sound is finished I want the play button to show up agian.
    Here is the actionscript:
    import flash.events.MouseEvent;
    play_btn.addEventListener(MouseEvent.CLICK,clickha ndler);
    stop_btn.addEventListener(MouseEvent.CLICK,clickha ndler);
    function clickhandler(event:MouseEvent):void{
    swapChildren(play_btn,stop_btn);
    what code should I add to my current code?
    I also can send you the Fla.

    You should consider using the Sound class. Here's a quick overview of it:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d21.html
    You'll be able to add event listeners to the sound to know when it completes so you can execute more code, such as swapping the play and stop button. There is an example in that overview of listening for the SOUND_COMPLETE event (e.g. channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);). It should contain everything you need.
    A basic example of what you'll end up with (there's many ways to do it) might look something like this:
    // just set up and wait for click
    var isPlaying:Boolean = false;
    var mySound:Sound = new MySoundInLibrary();
    var myChannel:SoundChannel = new SoundChannel();
    myChannel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
    // buttons
    play_btn.addEventListener(MouseEvent.CLICK,clickhandler);
    stop_btn.addEventListener(MouseEvent.CLICK,clickhandler);
    function clickhandler(event:MouseEvent):void
              swapChildren(play_btn, stop_btn);
              if (isPlaying)
                        isPlaying = false;
                        myChannel.stop();
              else
                        isPlaying = true;
                        myChannel = mySound.play();
    function onPlaybackComplete(e:Event):void
              isPlaying = false;
              swapChildren(play_btn, stop_btn);
    The basic idea is keeping a flag if the audio is currently playing. If it isn't then assign the sound to a channel and play it while setting the flag (isPlaying) to true. If it's already playing, set the flag to false and stop playing the audio.
    The swapChildren is run in the onPlaybackComplete() method so when the audio completes the play button is swapped back in front.
    Rather than swapping the children I'd urge you to toggle the .visible property instead. It's easy to run commands in the wrong order and get desynched on depth.

  • Video Gallery, How to Stop overlapping streams when user navigates to next item? Bug or syntax?

    My NASA Multimedia News App is exhibiting behavior that I would very much like to change. The app is in the store at
    http://apps.microsoft.com/windows/en-us/app/nasa-multimedia-news/7e74f3fb-b550-4ac6-b437-388f034ee6df
    If you look at one of the three video galleries, here is the scenario:
    1. Start one of the videos, for example the most recent one.
    2. without MANUALLY pausing the first video and before it finishes, scroll to the next item in the same gallery and PLAY it.
    3. two streams are now playing, audio overlapping.
    4. move on to the next item in the gallery OR GO TO A DIFFERENT PAGE/SCREEN, cover your ears.... 
    in fact the stream needs to stop if you navigate away from it by either starting a different video in the same gallery or when you navigate to a different screen/page in the app. and it doesn't.
    5. in fact, if you close the app by dragging it down and don't final close it by drag/hold flip or using taskmgr, if you re-open it the multiple audio streams will still be playing from where they left off.
    I don't honestly know if it is the video control or something I didn't do in the syntax (or even if something CAN be done), but with the overlapping cacophony that results, it is less than optimal. My expectations/hopes, were that if one stream was already
    playing, that moving to a new item and starting THAT stream would automatically terminate the original one that was playing so that only a single audio stream can be heard.
    I hope the issue is clear.
    Is this a bug? If it is by design, ugh. And is there a work around?
    -- Barb Bowman

    On Sat, 5 Apr 2014 01:20:04 +0000, thorwm wrote:
    >All kidding aside, I did some searching in the forum and I found this post that may help?
    >
    >http://social.technet.microsoft.com/Forums/en-US/6037342d-2575-411b-a496-90d306f82b00/unable-to-stop-a-video-playing-using-updatecontextvideopause-true?forum=projectsiena
    >
    >Btw, what you're talking about sounds very similar to how Adobe Flash works - it figures that you (the end user) must know what you're doing when you start another audio file / video so it keeps adding to the stream.  The way I helped
    the end user was to add the code to stop the media file playing when another one was selected.
    >
    >Hopefully the thread above gives you some ideas how you might do this in your situation. 
    >
    >
    >I look forward to hearing what you find - sounds like a neat app (no pun intended!)
    Thor, it is my NASA Multimedia App - I resubmitted it last night and I guess a
    different tester got it and the update went through. But the issue still exists.
    The difference between what I have in my app and that other thread is that I
    have a video GALLERY as opposed to individual players. I did try messing around
    with that  syntax
      UpdateContext({videoPause: false}); UpdateContext({videoPause: true});
    Navigate(scrHome, ScreenTransition!Fade)
     But it didn't work between screens in my App and anyway, half of the issue is
    that it wouldn't work on a single screen that contains a video gallery that has
    say 10 videos, there is no OnSelect function used. I tried experimenting to see
    if I could get syntax working at least for when the navigation is to a different
    screen, but it doesn't work for me. Probably because it is a gallery.
     Hoping that Robin has a solution...
    -- Barb Bowman

  • How to merging two audio stream using jmf?

    I have received two rtp audio stream,i want to merging this to one but createMergingDataSource dou work well。please help 。

    You might use an alternative approach: Run exec task and use a external tool to do the encoding.
    You can for example use "The Swiss army knive of Sound" :) SoX: http://sox.sourceforge.net/
    I think from a performance point of view or to handle large files it would be even recommended in using such tools rather then encoding inside your application ... that might be different if you need to do the encoding in real-time ...
    Sebastian

  • Premiere CS6 won't import mov files, the message: "file has no video or audio streams" shows up instead. How can I import the files?

    Premiere CS6 won't import mov files, the message: "file has no video or audio streams" shows up instead. How can I import the files?

    MOV is a wrapper that can contain many different codecs. The message you get is indicative of a distribution codec inside the MOV wrapper. You may need to convert the material to an editable codec before importing.

  • How to merge multiple live audio streams into a single stream in FMS?

    I need to merge multiple live audio streams into a single stream so that i can pass this stream as input to VOIP through a softphone.
    For this i tried the following approach:
    Created a new stream (str1) on FMS onAppStart and recorded the live streams (sent throgh microphone) in that new stream.
    Below is the code :
    application.onAppStart = function()
    application.myStream=Stream.get("foo");           
    application.myStream.record();
    application.onPublish = function (client,stream)
          var streamName = stream.name;
          application.myStream.play(streamName,-2,-1};
    The problem is that the Stream.play plays only 1 live stream at a time.As soon as a the 2nd live stream is sent to FMS then Stream.play stops playing the previous live stream.So,only the latest live stream is getting recorded.Whereas i need to record all the live streams in the new stream simultaneously.
    Any pointers regarding this are welcome.
    Thanks

    well i tried this once for one of my scripts and the final conclusion is its not possible to combine two streams into 1.....how would you time/encode the two voices......there is no know solution to this in flash. If you continue on despite me and find a solution please post it so we can explain to rest of world.

  • BEFW11S4 Hangs on audio stream

    I am accessing the Internet through a BEFW11S4 router, connected to a DSL modem.  I am using a wired connection - wireless is disabled.  The Router handles PPPoE, and manages DHCP for my computers.
    When I access the following audio stream (http://www.ouradio.org/index.php/ouradio/ouradio_asx/8190/ou.asx), the audio streams as it should, but the router then hangs.  I can then no longer access anything on the Internet, and cannot even access the Router's administration page.  Even when I stop the audio stream, it is still hung, until I reset the router (by cycling power).

    I did check the firmware, and it has the latest (1.52.03 7/9/05).  The hardware rev is 4.
    I tried with different computers connected to that router.  IT did nnot matter which one I used.  I do not have easy access to another network with a different router.

Maybe you are looking for

  • My i web version is 2.0.4. Can I publish my i web site directly to a FTP server address?

    After Apple stopped hosting with Mobile Me, I moved hosting for my i web built web site to Network solutions. I was told by a Network solutions technician that I can publish an updated iweb site directly to a FTP server address. But I do not see that

  • Acrobat Reader 10.0.1 and HP DesignJet 1055CM+ incompatibility

    Hello - I'm an IT administrator with my organization and we recently experienced a compatibility issue. We have four plotters on our network, one of which is a HP DesignJet 1055CM+. We're currently running Windows 7 64bit on the machines that connect

  • IDVD disk image burning

    I created a disk image from an iDVD project and now I want to burn it on DVD. I checked first on Apple DVD Player and VLC and the DVD played fine. Audio and video worked. Burned using Toast, but when I played it on my standalone DVD player, there was

  • Photo Book: Alert Symbol/Deleting Blank Pages?

    Greetings, Two questions: (I'm assembling a photo book for the first time...) 1. What does it mean when there's a small yellow alert symbol (a yellow triangle) in the upper right corner of my image? 2. How do I delete blank pages from the end of my p

  • TestStand 3.5 step run mode ingnored during execution

    Hi, I am seeing a problem in Teststand 3.5 to do with the step run mode. I have a sequence which i have a number of steps that i have set the run mode to skip. However when i execute the sequence some of the run mode skip settings are ignored, by thi