Loading a sound file from the library to play it in one frame

I am new to actionscript. I have a flash file with several frames. In each frame I need to play a sound file.
I've added all the sounds to the library and done all the necessary steps to export for actionscript.
Here's my code to play the sound in one frame.
var sound1:Sound = new Cal10101();
sound1.play();
This works great to play the sound. I am using buttons to move to the next frame. When I click the button to move to the next frame, I need the sound from frame 1 to stop and a new sound which would be Cal10102 to start playing.
How do I stop the sound from frame 1 from playing when I go to the next frame?
Thanks,
Steve

what you should do is use:
var sound1:Sound = new Cal10101();
var sound1SC:SoundChannel = sound1.play();
and before you goto the next frame execute:
sound1SC.stop();
// but you'll probably find it easier to use:
SoundMixer.stopAll();
before going to the next frame

Similar Messages

  • I just purchased a classic and some how deleated the audio book file from the library and the device section of iTunes, how to restore

    I accidently deleted the file folder audio books from the library and from teh device section in iTunes how to replace

    Edit > Preferences > General tab, tick Books. Audiobooks are synced from the Books tab of the device.
    tt2

  • How to remove dead files from the library?

    Hello.
    I'm using iTunes (7.6.1.9) on Vista (32 bit) mainly for synching my iPod (nano 3G). I organize my files with other tools like mp3tag. Sometimes I rename the folders where tracks are stored (e.g. I add the release year to the folder name). All this is done outside of iTunes.
    Now, when I want to access tracks in iTunes, it happens that iTunes doesn't find the files (because the folder or files were renamed). I can re-add the folder to the library, that's no problem.
    But how can I remove all dead files at once from the library? I don't feel like searching the complete library myself (for this is what a PC is made for, isn't it?).
    Is there any tool that can help me with this?
    Thanks in advance
    Martin

    You can use one of Roberst Jacobson's scripts - iTunesRemovenotfound:
    http://home.comcast.net/~teridon73/itunesscripts/
    Or if you prefere to do it in iTunes:
    Using a playlist to collect dead tracks for deletion.
    Create new regular playlist – Playlist1
    Select whole library and drag to Playlist1
    Create new Smart Playlist with the rule: Playlist is not Playlist1
    This playlist should contain all the dead tracks
    http://discussions.apple.com/message.jspa?messageID=5696793#5696793

  • Indesign won't let me drag in files from the library

    I did this fine on a mac, but on my windows Vista using CS4, I cannot drag with my mouse from the .indl library file.  I get the locked symbol when I try.
    I have restarted Indesign and reset my preferences but still no luck.  I have no idea why this is happening.  Can anyone help me?

    The first question is: can you use Place Item from the Library panel to place the same items?
    If not, there's something wrong with your library file.
    If so, there's something wrong with dragging/dropping.
    Could it be that you have two copies of the same library open? That can happen after a crash. It can result in this kind of mysterious behavior.
    Dave

  • How to read an audio file from the disk and play it?

    Do you know who to read an audio file from the hard disk and play it. It's for an application and not an applet. I tried with the Applet.newAudioClip(URL url) thing, but I keep getting a MalformedURLException.
    And is there a way to get the path of the file you are using? Currently I'm doing this:
    File file = new file("randomname");
    string = file.getAbsolutePath();
    file.delete();
    I'm sure there's a better way. And this is not for an applet, just a normal app.

    Below is a class that should be of use to you.
    package com.sound;
    import java.io.File;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.Clip;
    import javax.sound.sampled.DataLine;
    public class SoundPlayer implements Runnable {
         String filename;
         public SoundPlayer(String filename){
              this.filename = filename;
              Thread t = new Thread(this);
              t.start();
         }//SoundPlayer constructor
         public void run(){
              playSound();
         }//run method
         public boolean playSound(){
              try {
                   File file = new File(filename);
                   AudioInputStream stream = AudioSystem.getAudioInputStream(file);
                   AudioFormat     format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, format);
                   Clip clip = (Clip)AudioSystem.getLine(info);
                   clip.open(stream);
                   clip.start();
                   while (clip.isRunning()) {
                       Thread.sleep(100);
                   clip.close();
              catch (Exception e) {
                  System.err.println("Error in run in SoundPlayer");
                   return false;
              return true;
         }//playSound() method
    }//Class SoundPlayer

  • Loading my game files from the jar

    Hi again...
    I obviously have textures, maps, sounds, etc. for the FPS game to work. I want it to be in the jar file, but I'm having trouble loading the files directly from the jar, rather than from the files on my hard drive.
    Since I'm using, among other, JOGL, I require certaiin dll's for the game to work. How can I import the dynamic libraries in such a fashion that it can be somewhere in my jar file and still be loaded?
    Thanx!

    There is no button you can push in Premiere that will erase all your projects. Where were the .prproj files stored?
    Thanks
    Jeff

  • Recovering Files from the Library of a Deleted User

    I have been having major problems on a User Account that I copied over from Snow Leopard.    So I deleted the User account and intended to only move over the files I needed by leaving the Home folder accessible. But the folders I needed are in the Library and I cannot view the Library.
    I ran this command to make the Library viewable,
    chflags nohidden ~/Library/
    but it only worked on the Active Accounts.  I know the data is still there because of the size of the deleted User Account, but I cannot access the files.  Any suggestions.

    Download the program http://www.bresink.com/osx/0TinkerTool/download.php5 and select the unhide finder items and relaunch finder. Once you do that you can then navigate to the home folder of the deleted user and your Library folder should be visible and able to access your needed files.

  • Soundtrack -missing sound effects from the library

    Hi everyone,
    I have recently installed Soundtrack onto my computer ( I have FCE HD) and the content onto an external HD.
    Unfortunately I have noticed that there seems to be a fairly large section of sound effects missing, including "weapons" and "explosions". The reason I know these are missing is because there are greyed-out buttons for them where there is other ones present such as "Sci-fi" and others.
    Can anyone help me find where these are- or do i not get a full sound effect library with FCE?
    I'd be grateful if anyone could help.
    Cheers,
    Dave..

    Soundtrack Pro, that comes with FCP, is a different application, with more capabilities, than Soundtrack. Did you connect all your sounds up? If yes, if you selected the folder that contains them, then that's all you get. You can add more loops from sound libraries online. There are pre-built categories that the Acid loops format uses that will get assigned to the different sections as you add them.

  • Share files from the Library/Application Support folder between user accounts?

    I am using Mac OS 10.10.2, and am having trouble with allowing my son's user account to see his Minecraft files which are on my user account (User/Library/Application Support/Minecraft)   how do I make it so that Minecraft will find and use these files rather than the empty folder on his own user account?
    thanks!

    Thank you! I should have thought of that. So, what I actually did was go into finder, "get info" on the Minecraft folder, and check the "share folder" box in the info window.  I was then able to open his saved worlds on his account, and doing it this way will mean any changes to them can be accessed from my account as well.
    Thanks again!

  • I deleted files from the library through finder

    Now the files still show up in iphoto but if I double click it, it shows a broken image. In addition if I try to delete it (move it to the trash) is beeps at me
    I have even tried to command option start IPhoto with no luck either.
    any clues on how I can remedy this.
    thanks,
    David

    I decided to delete the event and re-import....

  • Files deleted from the Library and now internet doesn't work?

    Hello,
    I'm new here and this is probably going to sound dumb but... my father deleted some files from the Library by mistake and now internet doesn't work in his computer. Everything seems normal, but the webpages don't load (we tried lots of pages and 3 browsers). If you try to update any software it can't connect to the internet either.
    He reinstalled the system (it's Mountain Lion, I think) but it didn't worked (it was a partial reinstallation, without losing the data). He also tried restarting and pressing CMD-R but nothing happened.
    Any ideas on how to solve this problem? Thank you so much in advance! (and sorry for any typos, English is not my native language)

    Hello Eleone, & a warm Welcome!
    So what exactly isn't working or any messages you get?
    Does Mail still work?
    Might try this...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    (There may be better or faster DNS numbers in your area, but these should be a good test).
    Click OK.

  • Problem w/ ereasing a file from iTunes library! It simply shuts down iTunes

    Hi, can anybody help me? my problem is that every time that i want to erease a video file from the library iTUnes shuts down!! I cant even sync my iPod anymore because it says that "Itunes has detected a problem and must shut down"! Please HELP!!
    I already uninstalled iTUnes but I thought that this will erease all my library so I could sync my iPod again, when I re-installed the Itunes program there was my library again!! What can I do?
    Thx!

    This is Apple's support document on that subject:
    http://support.apple.com/kb/TS1389?viewlocale=en_US

  • Loading a text file from a relative location in shockwave

    Hi all
    I'm REALLY sorry I have to post about such an inane problem.
    I've googled this and looked in forums and found several
    suggestions but none of them are working for me. I want to load a
    text file from the same directory as my movie. I can get this
    working in authoring mode, in a projector, and in a shockwave movie
    on the local machine (using getNetText("/text.txt")).
    But when i put the shockwave movie on a server, it does NOT
    work. The macromedia documentation says that getNetText works with
    relative URLs. But when I put in the full URL, it does work, so
    obviously the shockwave movie is having a problem finding the text
    file which IS in the same directory as it.
    Any suggestions / ideas? All i want to do is access a text
    file :)
    Sorry again for such a lame problem
    Mike

    thanks - this worked. I also had to not use a repeat loop to
    wait for netDone() to return true.
    Thanks again
    MIke

  • Can't drag files from itunes library (to anywhere) anymore.

    Recently I've noticed I can no longer drag files from the library in my itunes. I can't drag them to playlists, and I can't drag them to the desktop.
    I have repaired permissions and even tried removing the library.xml file and let it generate a new one, but I still get the same result.
    I am on a mac os 10.6.8 Macbook Pro.
    I'm not sure when ths started happening, but I wonder if it has something to do with an itunes update. I have the newest version and always dwnload the updates. I can still add files to the library by control-clicking the files and selecting the option in the dropdown list. This isn't an intentional change in the way the program works is it? Is no one else having this problem??

    Iphone will sync or manually manage with one and only one computer at a time.
    Syncing or manually managing to another will indeed erase the current content and replace with the content from the new computer.

  • How can you retieve a list of classes from the Library

    Is it possible to retrieve a list of the Linkage or Export
    Classes from a swf library dynamically?
    I am building an application where I allow the user to load
    an asset swf at runtime, then they can choose to load any Exported
    class from the library of the swf. Currently it works if you know
    the name of the asset, that you want to load, but I would like to
    be able to bring up a chooser list of the assets, rather than
    having to type the Class names.
    So far I have only seen examples where "if you know the class
    name you can load it", but nothing concerning pulling the list.
    There must be a list somewhere in flash, I just want to tap into
    that.

    I saw this before and did not have a chance to go through it
    completely.
    As I was reading it, though it did not seem to be giving me
    the answer, as they seem to extend the Export clips in the library
    by extending the class.
    I'll run through that and see.
    It does give me another idea though.
    (crazy) Idea:
    What if I extend the loader class and add a method, kind of
    like what they are doing on the document class of the loaded swf,
    to pull the class names. They hard code in the class names into the
    array though.... so that is the crux of the issue.
    Somehow I think this concept is doomed to fail but, I will
    also see if that is possible.
    I suppose for the application, I could require that any user
    would use a swf with a document class that has the getAssets()
    method.... also has some problems .... namely dealing with the
    issue of "what if they do not extend" and having it fail
    gracefully.
    oh well, food for thought... I will leave this open for now
    and perhaps I will post some answer.

Maybe you are looking for

  • 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

  • Using translate function to correct character set problem....

    I have a table(TBL_STOCK) on Oracle XE. Rows come from sql server 2005 with a trigger on sql server table via the linked server. But there is a character set problem with some character like İ,Ş,Ğ. They change to Ý,Þ,Ð. in Oracle. How can i correct t

  • Moving average price/standard price via iDoc

    Hi, I would like to distribute moving average price and standard price on price change (price changed via transaction event or MR21) to external system. Is there a way to accomplish iDoc (MATMAS) triggering on price change? Any idea on how to track c

  • Abap webdynpro in GP . Is it possible?

    Hi all,     I have a basic doubt. Im able to create a webdynpro component in NWDS and able to get that in GP and im able to do all the parameter consolidation . Is it possible to create same kind of Abap webdynpro components which i can use in GP and

  • FCPX does not find disk

    I have put a LaCie ssd disk to my MacBook and try to move a FCPX project to it. De disk is connected thorugh either a ThunderBolt or the USB3 connection but in both case FCPX fails to see the disk. The disk however is neatly shown on the desktop. Why