Several buttons to toggle (for audio playback/stop)?

Hello

I was able to create a toggle button play/stop for a song with the following code

(I have 2 buttons for a symbol of video layer and then import an mp3 file):

toggle_btn. Stop();

var played: Boolean = false;

var mySound:Sound = new MySound();
var myChannel:SoundChannel = new SoundChannel();
toggle_btn.addEventListener (MouseEvent.Click, togglePlay);

function togglePlay(event:MouseEvent):void {}
(! played)? played = true: played = false;
(played)? myChannel = mySound.play ():SoundMixer.stopAll();

(played)? toggle_btn.gotoAndStop (2):toggle_btn.gotoAndStop (1);

myChannel.addEventListener (Event.SOUND_COMPLETE, soundCompleted);
}
function soundCompleted(event:Event):void {}
played = false
toggle_btn.gotoAndStop (1)
}

The problem is, I can't understand how to do several buttons to toggle different songs in a single file. Thanks for the help!

I use Adobe Flash Pro CC 2015 and ActionScript 3.0

Change the sound: mySound = new theSong();

Tags: Adobe Animate

Similar Questions

  • The external speakers with bluetooth audio playback stops working after 20 minutes

    I have a weird problem with bluetooth audio on my Acer Aspire 7600U. I have a bar of his JBL SB200 with support bluetooth and when I'm playing audio to it from my laptop (Sony Vaio) or my phone (Nokia Lumia) it works fine. But during audio playback of the IOA, the soundbar goes off after about 20 minutes in the middle of a song with such as Spotify. I suspect it's something different with the Aspire AIO bluetooth adapter which does not sound bar to stay on. No idea why? Does anyone else have this problem?

    I have now solved. It's another computer, I had who took control of bluetooth speakers every now and then...

  • JLab GO earpiece/headset Bluetooth connected but not available for audio playback

    I have connected the Bluetooth device and you can see the two Bluetooth devices as well as devices and printers.  But when I go into Control Panel and sound is not an option for playback or recording.  I uninstalled the device and repaired.  I also entered in the properties of the device and the Services tab and activated flow hands-free calling, Audio, headphones and remote control.  The device works fine on my 2 Surface Pro and my LG Android G2 phone. Any ideas would be greatly appreciated.

    Hello Pierre,.

    Thanks again for the response.

    I suggest you try using the steps described in this article and check.
    Reference:
    Error: "device driver Bluetooth not found" when you try to connect to a bluetooth device
    http://support.Microsoft.com/kb/2654568

    I hope this information helps.

    Thank you

  • Cp6: How to stop a slide with several buttons in a nonlinear presentation?

    Hello

    I would be very grateful for a solution to this issue, as I failed to find one yet in this forum.

    The presentation is non-linear, which means that the first slide is a kind of menu that you can choose another slide to explore and always comes back to the first.

    Each slide has several buttons that activate different audio files, and there is a button on the arrow in the lower right corner to jump to the first slide.

    The problem is that the slide does not stop after that you click on some of the audio buttons and continue on the next slide (instead of take a break until the user clicks on the arrow button). When I click a few buttons and listen to audio, eventually the slide automatically continues to the next slide.

    I tried:

    • Add button click box with "break project up to what the user clicks
    • change all the buttons for timing-> break after...
    • change only the arrow for Timing-> button pauses after...
    • and will not take unnecessarily long time to slide

    Any ideas?

    Thanks in advance,

    The best

    Acted

    You don't say 'how' to play the audio? In any case, the default behavior of interactive objects that trigger a simple action is out the read head. If you replace the simple action by a standard tip action one line, the playhead is not released. Watch this video (posterous is down once, again can not point to my blog):

    http://www.YouTube.com/watch?v=M3nKi-DB6Fw

    Lilybiri

  • Someone at - it a fix for audio stuttering which seems to take place several versions.

    Cause I don't not sure... horrible experience so far.

    > character host is not design to give you real time for audio playback

    Sorry, you have received this erroneous information. Ch is designed for audio playback in real time, and we have no reports of any audio in Ch is not not in real time.

    First step is to make sure you are using the latest preview, Preview 3. The version number is in the menu bar c.

    If you are still having the problem with Preview 3, thanks for posting here with your hardware & OS version info (see section system information here: FAQ: how to harvest information system and application for solving the problems? ), a description of step by step how reproduce the problem.

    Fish-gutter mentioned, Ch is currently in "Preview". We appreciate bug reports so that we do better.

    Thank you!

    PS private gutter-fish: about audio stuttering in AE, trying the latest version (13.7)

  • Audio playback on listening? When I started to work with more than 1 audio track.

    Hello!

    I have been using first elements 12 for the full HD video editing.

    Brand new for me just bought it 2 weeks ago.

    Now, during the last two weeks, I had this MAJOR proglem with audio editing.

    This problem is the headache and turn my simple editing in almost impossibilities.

    I had this problem with all my projects. SUBJECT

    Generally, the problem appears when I want to start working with multiple audio tracks.

    At somepoint that my projects just gets ruined, I do not mean just the audio tracks.

    The audio starts to disappear at random all audio tracks.

    It is not only about reading. When I exported the video, the audio has been partly missing, as well as the project.

    I tried to get help on the forums and find all that I could find, but have not been able to solve this problem.

    Small fix helped a little:

    I have the audio export to single track and bring back to the project. It works but I still usually edition more to do.

    I do not understand why reading disappears, I fear that this is a bug.

    I found a lot of problems in previous version on people with the same type of problems, but no help for this version of the program.

    To solve the case, I changed my audio setting in ss12.

    I tried to first WDM Sound and ASIO4ALL V2 components, but same problem on both.

    I have looked up my device for audio playback and ss12 matches are not on mute, and volume up.

    I deleted my first items appdata\roaming\adobe C:\ & first 12 items folder preferences... help do not...

    I press the update about every day in the hope of a new version... But yes, program always tells me it's the last.

    I usually work with 3 maxinum of audio track only. And I do really basic here stuff...

    I have put all my audio to the fore and he gave me the best results, but it does not appear to take the problem by far as at somepoint randomly my audio playback is missing again, randomly through the reading.

    Please someone? I feel desperate here.

    Info about my computer:

    Operating system: Win7

    Processor: AMD Athlon (TM) x 4 955 processor 3.20 GHz

    (vivid RAM) memory: 4GB

    system: 64-bit

    < left download, installation, setting up mod-kglad forum >

    Post edited by: kglad

    Tascruel

    Thank you for asking. I wanted to put that in my last answer and I forgot to do.

    The Adobe party line is that you cannot change a predefined project settings when it is enabled and that you are in the Premiere Elements workspace. I described a way to do in some cases when editing Notepad document of the project saved/closed (project.prel) file.

    http://www.atr935.blogspot.com/2013/05/pe11-changing-project-settings-without.html

    It is often easier to start a new project with the appropriate project preset, blocking the automatic action of the program in this regard. To do

    Open Premiere Elements in his workspace Expert.

    Go to file Menu/New/Project and in the project preset together preset that matches your source media properties. Before leaving the new project dialog box, make sure you have a checkmark next to the "Force selected setting on this project."

    Back in the workspace of elements Expert first, then go to add media/files and folders to your source media in the assets of the project which you drag the media from the source to the timeline.

    Please let us know if it works for you.

    Thank you.

    RTA

    Add it... Check your project settings via Edit Menu/Settings/general project, against the readings, especially in editing Mode, timebase, and image size.

  • Audio Play/Stop clip with a single button

    I'm having a hard time to understand how to use the advanced actions to enable / disable an audio button. I have read several articles and messages on the forum, but it is still confusing me!

    I want to create a button that can be clicked once to read data audio, click a second time to pause and click a third time to restart the audio (in the same place, she had stopped).

    Can anyone help with a really clear ride of the how to use the advanced actions to create this? There only seems to be pieces of the puzzle in the messages and blogs I've found so far!

    I started with a smart form which has a picture fill to a speaker:

    Screen Shot 2016-04-22 at 10.31.29.png

    I used simple actions for this audio trigger but there is now way to pause, and then start it again as far as I can see without the aid of a tip. My apologies if this has already been answered, but I can't find any post exact a walk has in the process.

    Thank you!

    Ruth

    OMG this is something totally different from the title of your son who literally said "toggle Audio Narration on / off. This title is not good at all for what you're asking here. You want a button for play/stop an audio clip. I'm going to your title in this way (using the power of my present by host)

    If you want an audio file to play when a button is clicked you use the command

    Play the Audio

    If you want to stop it using the command

    Audio triggered stop.

    If you want to use the same button for play/stop a specific audio clip, you must create a similar action, as I explained in th article toggle button, but do not use the variable cpCmndMute of system, but a user variable. It has almost the same meaning as the variable v_visib that I used to show/hide images. Tagged this audio variable v_audio, with a default of 0. The conditional action will then be:

    IF v_audio equals 0

    Play the Audio...           indicate the audio clip
    Toggle v_audio

    ON THE OTHER

    Stop audio Triggered
    Toggle v_audio

    I do not add changes state from here, can be done the same way, as described in the article.

  • Marker placement stops audio playback in 2015 CC

    I used CC (not 2014) before moving to 2015. I'm on Windows 7

    Because that I often place markers while you listen to the audio, in order to identify the specific rhythms and moments, my workflow slowed considerably due to the fact that place a marker causes the audio to stop playing.


    I press (.) to start audio playback (which is much slower to start in 2015 CC for some reason any and then I try to press (*) several times during audio playback to set markers in some rhythms music.) When I press (*) the first time, the audio stops, but the cursor continues to scroll the timeline panel.


    Anyway I can fix this or circumvent it somehow? It is absolutely crucial that I am able to place markers during audio playback.

    The update of the corrections after effects CC 2015 (13.5.1) is available, which corrects this problem: http://adobe.ly/1Il5JYe

  • No audio playback for hp pavilion m7 running Windows 7

    Following a Saturday night automatic update I lost all audio playback on my laptop. I tried to do a system restore and download and reinstall the audio driver. A bit of a loss here, suggestions?

    Hello

    Try the following.

    Download IDT Audio Installer on the link below and save it in your downloads folder.

    http://ftp.HP.com/pub/SoftPaq/sp57501-58000/sp57966.exe

    One time finished, open windows control panel, open Device Manager and open sound, video and game controllers.  Right click on the IDT device and select uninstall - also, you should get a command prompt to delete the current driver, check the box allow this and then proceed to uninstall.

    When you're done, shut down the laptop, unplug the AC adapter and then remove the battery.  Press and hold the Power button for 30 seconds.  Reinsert the battery and plug in the AC adapter.

    Robinet tap away at the key esc that you start the computer to launch the Start Menu, and then select f10 to open the bios menu.  Press f5 to load the default values (sometimes it's f9, but the menu below indicates the correct key), use the arrow keys to select 'Yes' and press ENTER.  Press f10 to save the setting and still use the arrow keys to select 'Yes' and press on enter.

    Allow Windows to fully - charge it will automatically load an audio driver, but let just this complete.  Then open your download folder, right-click on the IDT Installer and select "Run as Administrator" to launch the installation.  Once this done, do a right-click the speaker icon in the taskbar and select playback devices.  'Speakers and headphones' left click once to highlight, and then click the Set Default button - check if you now audio.

    Kind regards

    DP - K

  • My system hardware and audio changes playback stops suddenly. What can I do?

    My system hardware and audio changes playback stops suddenly.

    I ' v tried checking device in the Device Manager, it appears as properly installed and a sound test is attempted it says that it is used by another device.

    When the problem arises, I go to the Device Manager and do a right click on the device, then I click where it says 'Search the hardware changes' and then it starts working again, but for 5-10 minutes. Tops.

    Please help me...

    Hello

    1. What is the brand and model of the PC?

    2. are you aware of any hardware or software of the PC prior to this problem?

    3. is there another audio device connected to the system?

    This happens usually if the audio output settings are incorrect or if another audio device is attached to the system such as a complement for the audio card.

    Kindly, follow these methods and check if that helps.

    Method 1:
    Similar issues were corrected by restarting the Windows Audio service.

    Follow these steps:

    a. press the Windows key + R, type run and press Enter.

    b. type services.msc and press ENTER.

    c. scroll to find Windows Audio and Windows Audio Endpoint Builder services.

    d. do a right click and Properties, stop and start the services.

    e. click on apply and OK.

    Check the result.

    Method 2:
    You can turn on the speakerphone as default output device and check the result.
    Follow these steps:

    a. press the Windows key + X, choose CControl Panel.
    b. click on the its, a new window will open.
    (c) in the new window, click the read tab.
    d. right-click on the speakers and select set as default.

    f. click apply and OK.
    Check if it helps.

    Let us know the result. If you have any other questions, we will be happy to help you.

  • Audition CS5.5 suddenly stopped to audio playback?

    Hearing worked perfectly for a month since I got it,

    but all of a sudden, the audio has stopped playing? The tracker is still moving, and mixer levels are always jumping around like they do when you read something?

    In the Preferences menu, in the hardware Audio section.

    It is only to show "ASIO4all v2" as a device and nothing else - normally, there are at least 2 or 3.

    I did everything that I could think of (Yes, including turning market again)

    What should I do?

    I need to fix this quickly because I have a bit of work to do and I'm stuck until it's done.

    I also use a headset if that helps at all.

    Thank you.

    ASIO4ALL is just a wrapper for other devices on your system.  If you click on the settings button in the preferences of material, it should open the control panel of ASIO4ALL.  You'll want to make sure that the correct audio device is listed and enabled in the breast.  If a device is disconnected or the driver is updated, ASIO4ALL may not recognize it as the same device he was using before.

    Depending on which device audio, you have, you might want to try selecting Ms. as Audio driver option and select the device directly and see if you have a similar problem.

  • "Audio Windows has stopped working" and "host process for windows services stopped working.

    Hello. I recently had to reinstall windows vista on my computer. Everything works well except that I continue to have problems with the audio. When I play youtube videos or to make Skype calls, that the sound disappears and I get the message "Windows Audio has stopped working" immediately followed by the message "host process for windows services stopped working." I remember having this problem in the past, every time that I had to restore the operating system, but I don't remember what I did to remedy. I went to the history of my problem and it's certainly a problem with Windows Audio. What can I do?

    Hello

    1. The problem only affects Skype and Youtube videos?
    2. The sound works fine on the computer in other circumstances?
    3. You reinstall the audio drivers after reinstalling Windows?

    Try the methods provided and see if it helps to solve the problem.

    Method 1:
    Check out the link and follow the steps.
    Method 2:
    You can also visit this link and follow the steps in the article.
  • Audio playback starts and stops after a few seconds

    original title: Audio playback

    By my speakers (Windows 7) starts and stops after a few seconds.  I have troubleshooted but found no problem.  I configured and tested with good results, but the problem persists.  Anyone else know this or knows how to solve the problem? PLEASE HELP :)

    Hi NuttyNetty444,

    If you have not already the case, follow the steps in this document. This should solve most common sound problems in Windows.

  • HP Envy stop my Audio playback

    My HP Envy seems to interrupt my audio playback sound and to hear my music, that I have to restart my computer.  In addition, in Services, I tried 'restart' Audio, but it will not respond.

    If anyone knows how to solve this problem, I'd appreciate it.

    Thank you

    Only happens with headphones? Your sound works normally on the other speakers?

    In addition, what is your PC model number and what operating system are you using?

  • Disabled in Control Panel audio playback device, now I can't get it back for him!

    In my control panel > hardware and audio, I tried to Exchange my lack of reading, and to do that I hit "disable." he removed the device in the list so I can't select it to re - activate. It is always installed and can be found in my device manager, but I can't enable / define a default manager. How to get back the unit in question in my control panel? Thank you!

    Hello

    · What is the number and the model of the computer?

    You can run the troubleshooter from the link and check if it helps. Diagnose and automatically repair audio playback problems: http://support.microsoft.com/mats/no_sound

Maybe you are looking for