How to link audio to button to make it play and stop on click? Help please!!!!

Hi guys,
      I am trying to connect audio to the button so when I click on the button music it starts playing and when clicked again music stops. Any ideas??

assign your sound a class, say S.  you can then use:
var s:Sound=new S();
var sc:SoundChannel;
var soundon:Boolean;
yourbutton.addEventListener(MouseEvent.CLICK,btnF);
function btnF(e:MouseEvent){
if(!soundon){
sc=s.play();
} else {
sc.stop();
soundon=!soundon;

Similar Messages

  • I've installed Flip4Mac WMV in Lion and when I try to listen to audio in some sites, it starts playing and after about 0.5 seconds it starts playing again. So, I have the same thing playing with a delay... What is happening and how to fix it?

    I've installed Flip4Mac WMV in Lion and when I try to listen to audio in some sites, it starts playing and after about 0.5 seconds it starts playing again. So, I have the same thing playing with a delay... What is happening and how to fix it? Is there any other way to play theese kinds of files without using Flip4Mac WMV?

    Use Flash Media Server to stream the files.......set up a timer and have all three of them play at once....and have a button switch the streams depending upon which stream you want to play.....and wallah......
    you can also capture the stream.time from the video playing and resume from that point on the other videos as well....havent done this theoretically so I dont know how smooth the transistion between streams will be....but it can be done....
    plus u may have to use double buffering techniques to make sure it starts up right away......
    thelegendaryghost

  • How to remove the button "play" and "stop" in that flash animation?

    The animation is this one ...
    http://adf.ly/OTGyh
    Hello, I made a simple flash animation of a character talking ... The only problem is that this animation has the button "play" and "stop" and I do not want it ...
    I want so carry out the main character speak the message and stop yourself automatically without user intervention to push any buttons ...
    I have the animation code, how do I get this code to the buttons and start the animation so load the page?
    Ah, and how to put the link to a page by clicking on this open a flash site?

    How to do it step-by-step? Because i'm beginner in FLash and that things of animation, codes, functions...
    And I create that simple animation in other program, not using the Adobe Flash, but I think can be edited that file animation in Flash because I have the files ".swf" and ".flv"...
    I don't know how to do it in Adobe Flash CS3, but I have that program installed in my pc, then can you talk me what to do it?
    Sorry my bad english, i'm from Brazil.
    That is the folder contains the files:
    https://dl.dropboxusercontent.com/u/11826717/off/laranja/files_animation.jpg
    That is the Download the files of that folder if you want see better:
    https://dl.dropboxusercontent.com/u/11826717/off/laranja/laranja.rar

  • How to control the line in--- PLAY and STOP ?

    Hi,
       This is the  volume control library downloaded  from NI wed site .It is help for my task.
       My task is to control the line in with LabVIEW, for example STOP, PLAY and adjust volume with LabVIEW button.Though the example I see the volume control can  be enablement.But I don't know how to design the PLAY and STOP button.
       I see it is similar to the volume control.There is function to control the the PLAY and STOP in the system Library-winmm.dll. I don't know  whether all I think is right.I have the following serial question. How to use the function?How to understand the system Library?I can't acquire some information  from it and I don't know the input and output parameter in the funcion.
       Can any one help me out please?
       I'm sorry that my English is poor.
       Thanks.
     lizhi
    Attachments:
    VolCtrl.llb ‏193 KB

    I assume you are referring to audio line-in volume control and lerft-right balance...
    If so, then check out this thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000D83A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Look at the info near the bottom from Paul S & Spectre. They talk about "winmm.dll"
    -cheers-
    JLV

  • HT201272 Tried to re-download previous music purchases, but the download button reads 'Downloaded' and is inactive. Help please. Thanks

    Tried to re-download previous music purchases, but the download button reads 'Downloaded' and is inactive. Help please. Thanks

    Welcome to Apple Support Communities
    As you know how to open the iTunes Media folder, go to this folder and open iTunes. Then, go to Apps in iTunes and drag the IPA file of the app you want to show up to the iTunes window, so it should be added.
    If it doesn't work, delete the IPA, empty the Trash and you will be able to download the application.
    If a post solved your question or helped you, mark it as solved or helpful before posting a reply. Doing this, you will avoid that your own post is marked as solved or helpful. You won’t receive any point if you mark your own post as solved or helpful. Also, you won’t be rewarding the user who solved your question and you will help other users find the answer if you mark the correct reply

  • How could i cancel a purshed app from itune store and stop payment from my crediet card

    How could i cancell a purshed app from itune store and stop payment from my vredit card

    Contact iTunes Store support staff through the report a problem links in your account history or,
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html - Apple states all sales are final, but you can ask.

  • After updating my Iphone 5 my lock button isnt working well .... Need help please ..

    After updating my Iphone 5 my lock button isnt working well .... Need help please ..

    First, read here:
    https://ssl.apple.com/support/iphone5-sleepwakebutton/
    See if your phone is affected.

  • My ipod has just black screen and the home button is not working. what will i do? help please!

    my ipod has just black screen and the home button is not working. what will i do? help please!

    Try:
    - iOS: Not responding or does not turn on
    When it says place the iPodin recovery mode use this prgram.
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • I use Microsoft XP on my PC, where r my pictures from my iPad? I need to know how to send pictures to Walgreens, etc so I can get them printed. Help please!

    I use Microsoft XP on my PC, where r my pictures from my iPad? I need to know how to send pictures to Walgreens, etc so I can get them printed. Help please!

    I am legally blonde and not very tech savvy, so I don't really know how to do that.  I know ur time is valuable, so could u possibly give me a short tutorial?  I would b very grateful! I use the camera kit to get my pics from my sd card to my iPad and also from my iPhone to my iPad. Had I known I would have this problem, I would not have transferred my pics to my iPad until after I took the sd card and had my pics printed.

  • New mail button does not respond so can't write mail. help please?

    New mail button does not respond so can't write mail. help please?

    I am no expert, but open your mail, go to the top of your apple bar click the apple sign then force quit mail, restart and it may work.
    I had this issue before and it was resolved.

  • HT5312 I can't get a rescue email to reset my security questions. I clicked the link but there's no massages in my inbox alternate email. Help please :(

    I can't get a rescue email to reset my security questions. I clicked the link but there's no massages in my inbox alternate email. Help please :(

    You are checking your rescue email account - an alternate/secondary email address is a different setting/address on an iTunes account. If it's not in the spam nor inbox then you could try requesting it again, or contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699

  • Itunes wont allow me to buy a song etc... i click the button and nothing happens? help please

    itunes wont allow me to buy a song etc... i click the button and nothing happens? help please. i can preview songs and click on everything but when i go to buy something it clicks but nothing happens

    I too had this problem after I redeemed two $50 gift cards.  I solved the problem by uninstalling iTunes and reinstalling it.  Give it a try.

  • How do i create a button that will always play my flv, not just once?

    I'm currently using captivate 5.5 and need to use a button to load my flv.  That button works fine and when the flv finishes it returns me back to the slide with the button on, the problem is the button no longer works when you press it again if you want to see the flv again...help!  My flv is set up to not be visible as I want it to be hidden until the button is pressed as it cover my entire slide when it loads.  I set it to run for the duration of the clip so it's great when it returns me to my slide but then the button won't make it visible again when you press it.  I tried setting the button to enable after show hoping it would reset the button but that doesn't work...as you can see I only know the basics of Captivate!

    The issue may be due to the fact that once you've clicked the button its Success criteria has been used.  This can be reset by re-entering the slide where the button is located.
    So in order to have your video play multiple times, you may need to use a different strategy than your current one.  You could try placing the video on a different slide to your button.  Set the button click to jump to that slide, and once the video has finished playing, set the OnSlideExit action to jump back to the slide with the button.  That way your button gets reset each time ready for another click to launch the video slide.

  • Vista Ultimate, Firefox 4.01 just installed. The back and forward buttons do not work with this new installation. Help please.

    O?S is Vista Ultimate 32 bit fully updated. I have just installed Firefox 4.01. I have lost use of back and forward buttons - they are greyed out. Is there a solution please?

    It is possible to have earlier data in a tab if the latest tab had target="_top" that means the back key will not work, but if your right-click on the back/forward you see a context menu. As far as I know the only difference between 3.6 and 4.0 ws that the drop-down arrow was dropped but like before you can still right-click.
    There are some extensions that mess with the Back/Forward buttons.
    There is a difference between gray and '''black''' on the buttons, '''black''' means there is history in that direction.
    You can make Firefox 4.0.1 and Firefox 5.0 look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • HT4759 i use icloud, butn not sure  how to delete some data that i no longer use, to free up space, help please

    I need some help with my icloud, i have data that i no longer use and dont know how to delete it off my iphone or itunes, help please. im not to good with computer so please make instructions as easy as possible, thank you...

    Hello, sweeper123.
    Thank you for the question.  The articles below will help you in managing your iCloud storage.  The first article covers what information is backed up.  The second article will walk you through how to manage your iCloud storage.  
    iCloud: Backup and restore overview
    http://support.apple.com/kb/HT4859
    iCloud: Managing your iCloud storage
    http://support.apple.com/kb/ht4847
    Cheers,
    Jason H. 

Maybe you are looking for