How can I stop loading if the user selects another mp3 mp3?

I work with a lot of mp3 files and I want to be able to stop an MP3 of loading from the server if the user selects a different mp3. How can I do this?  Here is my code so far:

function startNewSound (): void
{
var mySound:Sound = new Sound();
mySound.load (new URLRequest (tempo + ".mp3"));
mySound.addEventListener (Event.COMPLETE, soundLoaded);

function soundLoaded(evt:Event):void
{
sndChannel.stop ();                   his previous is stopped
sndChannel = mySound.play (0, int.) MAX_VALUE);
myTransform.volume =-volumeNum/100;
sndChannel.soundTransform = myTransform;
}
}

Any help is greatly appreciated.

Your code can be something like this:

var mySound:Sound = new Sound();// listeners should be added BEFORE load is calledmySound.addEventListener(Event.COMPLETE, soundLoaded);var sndChannel:SoundChannel = new SoundChannel();

function startNewSound():void  {     mySound.close();     mySound.load(new URLRequest(tempo + ".mp3"));}

function soundLoaded(evt:Event):void{     sndChannel.stop();  //previous sound is stopped     sndChannel = mySound.play(0, int.MAX_VALUE);     myTransform.volume = volumeNum / 100;     sndChannel.soundTransform = myTransform;}

Tags: Adobe Animate

Similar Questions

  • I bought my computer from someone else. Change user accounts did not name of each file in the computer. How can I change or remove the user/name (my name) /document? __

    I bought my computer from someone else. Change user accounts did not take their name off of each (or more) file in the computer. How can I change or remove the user/name/document
    I have looked everywhere and changed user information and the name of the administrator. What can I do else?

    Hello flashgordonjxn,

    Who has ever done the installation of Windows, the installation program asks you to enter your name and optionally, the name of the organization. These registration information appears under recommended for in the general tab of the System when you click Start, click Control Panel, click performance and Maintenanceand then click System.

    To change see instructions below:

    1. Click Startand then click run.
    2. In the Open box, type regedit, and then click OK.
    3. Look for the following registry key:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    4. To change the name of the company, follow these steps:

      In the right pane, double-click RegisteredOrganization. Under value data, type the name that you want, and then click OK.

    5. To change the name of the registered owner, follow these steps:

      In the right pane, double-click RegisteredOwner. Under value data, type the name that you want, and then click OK.

    6. Click Exit on the file menu to exit the registry editor.

    Hope this helps you. Let us know anyway. Make it a great day!

    "And in the end the love you take, is equal to The Love You Make" (The Beatles last song from their latest album, Abbey Road.)

  • How can I stop firefox from the offer to remember my passwords?

    I don't want ANY program to offer to remember my password. Ask Firefox several TIMES to remember this information anywhere, anytime, that I connect to work or personal sites. I'm quite capable of remembering my own passwords, and the pop up key icon is really very annoying. How can I stop this feature?

    See also:

  • How can I remove comments from the users and groups

    I have my in my users and groups in the system preferences a user snd invited another user

    How can I remove them

    Go to Preferences system-> users and groups, and then press the lock to allow you to change the settings. Then choose 'user comments' in the sidebar and uncheck "Allow clients to connect to this computer". This will not make this option disappear, but after that you will not be able to use the Guest user.

    «Respect for the other user, simply choose it in the sidebar and press on the '-' button.» Make sure that no one uses this user.

  • Adobe Captivate 7 - How can I stop AutoPlay from the slides at the end of the enclosure of the slide?

    Hello

    I produce an e-learning with many slides that are set to music. I noticed after the export slide that starts automatically when they are reached. It is wanted, but it isn't good that after the duration of the slides which depends on the duration of speakers the next slide open automatically and starts playing.

    How can I reach that a slide with a speaker stops playing after the speaker is finished, so that the next few slides is open only by clicking on the button next in the PlayBar?

    I assume you mean audio slide? Add a click box to each slide and extend its duration until the end of the slide, which can easily be made with the hotkey CTRL-E. A click box will automatically pause at its end, which will be at the end of the slide.

    Add to the first slide and set up as explained and copy the click zone. Then go on the Filmstrip, select all the other slide and paste it.

  • How can I stop or remove the earpiece in linux

    Hi guys
    I encountered an error when I tried to stop the listener in linux environment

    Outputs:

    [oracle@localhost ~] stop lsnrctl $

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on January 6, 2010 01:38:37

    Copyright © 1991, 2007, Oracle. All rights reserved.

    Connection to (ADDRESS = (PROTOCOL = tcp)(HOST=) (PORT = 1521))
    AMT-01189: the listener could not authenticate the user

    [oracle@localhost ~] lsnrctl start $

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on January 6, 2010 01:39:21

    Copyright © 1991, 2007, Oracle. All rights reserved.

    AMT-01106: listener by using the name of the LISTENER listener has already begun

    [oracle@localhost ~] $ lsnrctl stop LISTENER

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on January 6, 2010 01:42:06

    Copyright © 1991, 2007, Oracle. All rights reserved.

    Connection to (ADDRESS = (PROTOCOL = tcp)(HOST=) (PORT = 1521))
    AMT-01189: the listener could not authenticate the user
    [oracle@localhost ~] lsnrctl start $

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on January 6, 2010 01:42:18

    Copyright © 1991, 2007, Oracle. All rights reserved.

    AMT-01106: listener by using the name of the LISTENER listener has already begun
    [oracle@localhost ~] $

    can someone tell me what I should do next?

    I used vmware

    I suspect that the OS/VMWARE networking is misconfigured.

  • In the spell checker, how can I stop it showing the contractions as a spelling error?

    I am writing a novel and using lots of contractions (i.e., don't, can't, didn't, isn't, etc..)  Spellcheck shows everyone as a misspelled word.  How can I

    change the spelling or grammar checker to accept these contractions?

    It depends on what software you use, and I'm afraid that you neglected to mention that.

    If you are using Word 2007, it marks the words as cannot not and was not.  I just checked.  When it report a spelling error, it gives you a chance to add to the dictionary, which will prevent it in the future.

  • How can CC program installed on the user's computer?

    Dear please help

    my IT admin cutomer using the COMMON tariff with 20 reviews and intend to detect what kind CC program installed on the user's computer? all programs to detect?

    concerning

    Deto

    We can detect if the CC has been activated, but we can't detect what the app program CC has been installed & activated the subscription of the CC.

    Activation can be detected but not the product in question.

    Concerning

    Baudier

  • How can I move photos from one user to another user on the same computer?

    If its possible that it is.

    If its possible that it is.

    The simple way is to move A user account photos to the PUBLIC folder.

    * Public folder is open to all users *.

    Once they are in the folder Public, just drag and drop photos on behalf of user B.

    I prefer to use the option copy to or Move To instead of drag and drop.
    Put all the photos in a subfolder > right-click in this subfolder > click on move or copy to > navigate to the folder of the user account B > click on move or copy.

    If you have no options copy verses and Yo move pop-up menu right click, here is a tutorial to install it:
    http://www.Vistax64.com/tutorials/89196-context-menu-add-copy-folder-move-folder.html

    Use an easier Option.

  • How can I give sysadmin rights of user to another user?

    Hi all I am trying to find any solution to give a bit of administrator rights from user to another user for example to track workflow applications. ? Is there a way?

    but I can check the workflow admin is *?

    Please see (the user is able to query only the elements of workflow, they possess to Status Monitor [755223.1 ID]), he shows how to check for the back-end (database) or application (via the responsibility "Workflow administrator Web Applications").

    You can also see the following docs for the navigation of the application path:

    How to reset the administration of the process [413711.1 ID]
    11.5.10 workflow System Administrator LOV field cannot be changed after the upgrade to the responsibility of the administrator system [308160.1 ID]
    More information requested Notification allows applicant to approve [ID 726696.1]

    Thank you
    Hussein

  • How can I get rid of the tool selection Rectangle and cursor fair use?

    I have the small line for the marquee tool appear and I can't cancel it. I know it of simple but just can't find it. Thanks assistants, CCCma

    What version of logic are you running?

    Press T, T to change the marquee selection tool pointer tool in Logic Pro X

    Press ESC and 1 to change the marquee selection tool pointer tool in Logic 9

    If you are talking about the white vertical line... Just click on the track or background to make it disappear.

    or menu view Local - uncheck the marked ruler.

  • How can I remove my password, the user name et al. of the Tablet

    HP 7.

    I created a user name and password for this Tablet; have decided to sell. You will need to clear remove all usernames and passwords.

    Instructions of it please.

    Instructions can be found on the Pages of the HP Support for your device.

    WyreNut

  • How can I try to anticipate the user's screen size/resolution?

    I would like to help with how to test my web pages to see what he might look like with smaller screens.
    First off, the site is for an artist fine art then his most important audience will probably use much larger monitors, I guess they are but which is not based on empirical evidence.  But I still want to know that the site looks good on a small monitor with lower resolution.  I just watched my first attempt on my screen work and things have changed a lot.  At home, I use a 26 "what is new and at work, it's a cheapo 19"
    My structure can contain up to but quite different white space and the size of the images and make the site look less uh... refined.
    So here are my questions.
    one) can I set up my own pc to emulate small screens with low resolution without having to change the native resolution?
    (b) I am worrying needlessly?
    (c) is someone aware of a tutorial out there?
    Thank you
    Martin

    Web development toolbar has a resizing of the window option... I use it all the time;

    Web Developer Toolbar

    http://chrispederick.com/work/Web-Developer/

  • How can I stop randomly ding-* the sounds coming from my computer?

    Help! Every two hours, I get a random ringing * sound of my desktop computer, if there is a web page open or not. The sound comes from speakers but is not related to the speakers themselves. The sound is the "notify" windows wave sound, like a "ding *.»  It happens totally randomly, without warning and without apparent reason. Can someone help me remove it? I use Windows 7. Thank you!

    Look in the event viewer for event occurring at that time there

  • OfficeJet Pro 8500 a Premium: How can I stop checking in the middle of printing printer?

    I have something that contains 28 pages of print, then click on print something that has 40 pages, but before I could, the printer starts a sort of head cleaning and then a check printer long.  Is it possible to wait a few minutes after printing something, prior to that, it?

    I am not afraid. The feature is integrated into the firmware, and although annoying and time consuming, there is no way to turn it off or delay. I'm sorry.

Maybe you are looking for