Randomize sound Effect and play effect from a spinnerList

I have two separate questions:
I have 8 different sound effects and a spinner list, in simpler terms, what do I need to do to assign 1 sound effect to each of the selections on the spinnerList, and then have the corresponding sound effect played when the user presses a button?
Secondly, what do I need to do to make it so that every time a dofferent button is pressed, it plays a random one of those 8 sound effects?
Some sample code would be great. Thanks.

The basic approach to picking something randomly:
  // here's my array of items to choose from
                                        var strings:Array = ["a", "b", "c", "d", "e", "f", "g", "h"];
  // pick one of the items randomly
  // Math.random() gets a random # n where 0 <= n < 1
  // Multiply by array length to get a random index
  // Math.floor() makes it an integer index where 0 <= n < Array.length
                                        var s:String = strings[(Math.floor(Math.random() * strings.length))];
HTH,
-- Tom

Similar Messages

  • Is it permissible to upload a video on youtube with music, sounds effects, and video effects from imovie?

    Lately, I've been editing and making videos for a local church in Mexico. I am not selling any of the videos. The are free to watch. However, is it permissible to upload a video with music, sound effects, and video effects from imovie? I using imovie version 10.0.2

    This question comes up from time to time.
    There are a number of con-men who think that they can earn a quick buck from claiming that they own the copyright to Apple’s royalty-free jingles and sound effects included with the iLife applications. These are all free to use, as clearly stated in section 2.C of the iLife Software License Agreement:
    “You may use the Apple and third party audio content (“Audio Content”) contained in or otherwise included with the Apple software, on a royalty-free basis, to create your own original soundtracks for your video and audio projects. You may broadcast and/or distribute your own soundtracks that were created using the Audio Content, however, individual samples, sound sets, or audio content may not be commercially or otherwise distributed on a standalone basis, nor may they be repackaged in whole or in part as audio samples, sound files, sound effects or music beds.”
    http://images.apple.com/legal/sla/docs/ilife09.pdf
    You should quote this (also providing the above link) when following any dispute process with YouTube.

  • Can I disable games sounds/music and play from my music list while playing games?

    Can I disable games sounds/music and play music while playing games?

    Yes that is possible. All you have to do is go into the sound setting of the game and turn it off from there. Then you go into your music and play which ever song you want to play

  • When I first attached a cable from iphone6 to hdmi on tv, I was able to read kindle on tv. After watching movies and playing Pandora from iphone to tv through the cable, I can no longer read kindle through it. What settings do I need to change?

    When I first attached a cable from iphone6 to hdmi on tv, I was able to read kindle on tv. After watching movies and playing Pandora from iphone to tv through the cable, I can no longer read kindle through it. What settings do I need to change?

    Hi,
    Already mentioned on the following post:
       http://h30434.www3.hp.com/t5/Other-Notebook-PC-Que​stions/VGA-on-laptop-HDMI-on-TV-needs-connected/m-​...
    You need a CONVERTER, not ADAPTER The setup:
    The following list may help:
         http://www.ebay.com.au/sch/sis.html?_kw=HDMI+To+VG​A+COMPONENT+Adaptor+A+V+Digital+Converter
    Laptop (VGA) ---- Converter from VGA to HDMI ------ TV
    You also need sound, you can buy a converter with sound OR connect sound directly from laptop to TV.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How can you create a playlist with music and music video and play those from same playlist through Apple TV?

    How can you create a playlist on Ipod touch with music and music video,  and play those from same playlist through Apple TV?  I can download, create a playlist with both music and music video, stream that through the Apple TV with no problem.  The sound and the information show up on the TV, but when it gets to a music video, it only shows the information and "artwork".
    I also have a video playlist - videos play fine through the Apple TV, but will not shuffle through all videos - continues to repeat the same one.  I have most definitely selected shuffle in both locations - from the playlist and on the ipod video screen while video is playing.

    I finally got it... had to sync the photos with the music in iMovie, arrange the voiceover in GarageBand then export to iTunes, and then I was able to put it all together in iMovie and burn in iDVD... had a few glitches along the way but finally finished : )
    Message was edited by: jpewald

  • CKM3 - PPV analysis: split between exchange rate effect and price effect

    Dears,
    I need to verify how the purchase price variance (PPV) is calculated within the Material Ledger, specifically regarding the split between exchange rate effect and price effect.
    I found transaction CKM3 that display the exchange rate difference and the price difference (I think total price difference = exchange rate effect + price effect), but I still have some open points:
    - How CKM3 should works? I created some documents to test this transaction (goods receipt from purchase order and its invoice) creating a PPV with exchange rate effect and price effect (both) but in CKM3 the split is not shown, only the total PPV is shown at document level.
    - Is there same specific procedure to be followed? Is there other steps to be done before CKM3 is executed in order to split the PPV?
    and then
    - Is CKM3 the best solution to analyze the PPV within Material Ledger?
    Thanks and Regards,
    Jody

    Tnx Adi,
    this link is very helpful, now I've an idea about how the data should be shown in CKM3.
    But at the moment I replicated a similar case to the example mentioned in the link, and in CKM3 I see different values: all PPV amounts are only present in column "Price difference" without the part due to the exchange rate effect.
    Do you know if I need to execute a preliminary step before to execute CKM3? Or is there something to be set-up in custominzing in order to allow the correct population of the exchange rate price difference?
    Thanks & Regards,
    Jody

  • I have a docking station to charge and play audio from my ipod touch 3rd gen.  Just bought a new ipod touch 5 th gen.  Is there a converter/ adapter available so I can continue to use my dock?

    I have a docking station to charge and play audio from my ipod touch 3rd gen.  Is there an adapter available for the ipod touch 5th gen so that I can keep using the old dock?

    Lightning  Adopters
    One of these adopters/cables should work:
    http://store.apple.com/us/product/MD824ZM/A/lightning-to-30-pin-adapter-02-m?fno de=45
    http://store.apple.com/us/product/MD823ZM/A/lightning-to-30-pin-adapter?fnode=45

  • Trying to use headphones to watch a show online...  sound still comes out of the internal speakers, not through my headphones.. i used help, said to go to sound preferences and choose headphones from the output pane, but it doesn't list headphones

    trying to use headphones to watch a show online...  sound still comes out of the internal speakers, not through my headphones.. i used help, said to go to sound preferences and choose headphones from the output pane, but it doesn't list headphones

    trying to do this on a macbook pro...please help

  • Can I move my mmorpg game over to the time capsule and play it from there?

    I have a MacBook Pro with a 256 SSD. I play World of Warcraft and it is taking up a lot of room on my macbook. I was wondering if I would be able to move the  game folder over to the airport time capsule and play it from there. Or would if not work cause the time capsule isn't fast enough? The apple guys on my base don't know enough to answer my question and there is no apple store here on the island I am stationed on.

    If you do not have enough space on the SSD, do not move the gamefolder to the TimeCapsule: this is much to slow; instead move something else there or use an external HDD or SSD.

  • Using the Remote App and playing iTunes from a shared Library

    I have a playlist set up in my main iTunes library on my iMac.  This is a shared library on my local network at home.  I can access and play the library remotely from my MacBook.  I want to move my MacBook outside with external speakers for a party.  I want to be able to access the shared library from the iMac inside the house from my MacBook and be able to control it with the Remote App.
    My problem is that when I use Remote and the MacBook outside (I've set up the iTunes passcode with that computer and my iPod) it will only recognize the library on that computer, even if I am logged in to the shared library and it is visible in the MacBook.  So basically, remote is doing what it is suppose to do in a normal situation, but I need it to recognize and play from the shared library.
    When I turn on home sharing on the iPod I can access all the libraries on the various macs in our house, but the music will only play out of that particular machines speakers.
    I don't have wireless speakers, so I can't think of another way to do this.  Is there?
    Thanks, Sandy

    Well, I've got it to work although not ideal. 
    1. On my main computer (iMac) I created the playlist that I want available to control at a party.
    2. I went to iTunes settings/Sharing and selected "Share selected playlists" and checked the playlist I made for a party.
    3. I Linked my iPod to MacBook (which is outside with external speakers) using the 4 digit code
    4. iPod, Home Sharing Off
    5. Select the Library on iPod
    6. Select "More" (bottom right of iPod)
    7. Select "Shared" from the list that appears
    8. Select the computer that has the shared library
    9. Select the playlist (or lists if you created others)
    This setting is allowing me to use my iPod "Remote App" to play an iTunes playlist (or the entire catalogue) from a shared library on my MacBook WITH the sound coming from my MacBook and NOT from my iMac where the original iTunes catalogue is located.
    Not sure if this is the easiest way, but it's working.

  • How can I import playlists, ratings, and play counts from an old iTunes library into a new one?

    After reading countless threads re: how to get the iTunes artwork screensaver to work, I decided to delete my iTunes library file and reimport all of music which resulted in fixing the iTunes artwork screensaver.  Unfortunately (and expectedly), my playlists, playcounts, and other information were lost with the creation of a new library.  Is there any way to import the playlists, ratings and play counts for my music from an old library file to my current one?  I realize this may be complex, but I'm up for the task.
    Thanks in advance,
    B

    I can't begin to describe how frustrating the screensaver issue has been for me (and I suspect countless others, judging by the number of threads on the topic). 
    I took your advice, though, just to test it.  After backing up my current library.itl, I copied and pasted the old .itl file into its place.  As expected the playlists, play counts, etc were instantly restored.  And now the screensaver fails to work with the dreaded error 'No iTunes artwork found' which makes me think it IS an issue with the old library file.  The only work around I've seen so far is to rebuild the library (which I did). 
    I'm afraid I'm going to be forced into choosing either a working screen saver or all my itunes data.  Very frustrating indeed.
    Here's a link to the 'definitive' fix for the screensaver, if you're interested.
    https://discussions.apple.com/thread/3695200?start=0&tstart=0
    Thanks again,
    B

  • Can i show and play music from my external hard drive in iTunes without adding it to my Mac hard drive?

    I have more music than I can keep on my Macbook hard drive by over 200GB. I'm hoping to be able to show and play all music from my external hard drive in iTunes without having to add any of it to my Macbook Hard Drive

    Hello B3NN13,
    If you would like to add the music from your external hard drive to iTunes without copying it to the iTunes Library on your internal hard drive, you may find the following article helpful:
    Add files to your library without adding them to your iTunes folder
    When you add an item already on your computer to your iTunes library, iTunes places a copy of the file in your iTunes folder. The original file remains in its current location.
    You can change this setting so that files are added to your iTunes library without being added to the iTunes folder. You might want to do this, for example, if you prefer to store video files on an external disk but still want to view them in iTunes.
    Choose iTunes > Preferences, and click Advanced.
    Deselect the checkbox next to “Copy files to iTunes Media folder when adding to library.”
    From now on, when you drag a file to your library or choose File > Add to Library, the item appears in iTunes, but the actual file isn’t copied or moved.
    Tip: You can temporarily reverse this setting by holding down the Option key while you drag files to the iTunes window.
    iTunes 12 for Mac: Change where your iTunes files are stored
    Sincerely,
    - Brenden

  • I was downloading music to my iTunes account and playing music from my I tunes library when all of the sudden it stopped playing and the control panel won't let me restart the music.....why

    I was downloading music cd from my PC to my I tunes library and playing music on the I tunes player at the same time when all of the sudden my music stop playing and I can't get the I tunes player to restart playing music from my library again. The I tunes equalizer / player box with timer shows the song ready to play but the controls won't restart the song.......why not, and how to I get it to restart playing my library?

    - You need to restore the iPod to factory defaults/new iPod and start anew.  Is the restore button visable in iTunes?  If it is they restore the iPod.
    - If it is not visible try resetting the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - If the restore button is still not visable, try placing the iPod in recovry mode.  See:
    iPhone and iPod touch: Unable to update or restore

  • Disabling sound equalizer and other effects on HP Pavilion DV6 with beats audio

    Hi
    We are using the DV6 with beats audio as a platform for our device.
    In order for us to do that, we need to disable every filter, equalizer, noise cancelletion, etc' on the laptop.
    How do we do that? any ideas?
    Thank you,
    Guy 

    Check the solution from the link below:
    [Fix/Workaround] Beats Audio Volume Problem (leveling/random adjustment etc)
    Warning !
    The above solution is risky. You will do this at your own risk.
    Before you will do anything please create a set of recovery discs.
              Resource:
            Using HP Recovery Manager in Windows 7
    Create a restore point. If something will go wrong you will be able to restore the system to the point where everything worked fine:
              Resource:
            How to Create a System Restore Point in Windows 7
    ** Say thanks by clicking the "Thumb up" icon which is on the left. **
    ** Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue. **

  • My iTunes library has too much on it.  is there a way to export it to an external hard drive and play movies from there?

    I have nearly filled up my hard drive with movies on itunes.  i know i can export everything to an external hard drive, but is there a way to export only the movies, delete those from my hard drive, and then play the movies with the external hard drive connected?

    If they don't contain DRM, use a program such as Switch. If they do, you can't.
    (59769)

Maybe you are looking for