Random Sound Array Issue

Been trying to implement a random sound picker on the main
timeline. (Keeping in mind it needs to work in AS1)
All my sounds are correcly identified under the "linkage"
propreties.
Somehow, my array value always comes up undefined. And none
of the sounds would play.
Help would be greatly appreciated.

"Detonate 2004" <[email protected]> wrote in
message news:eaq6n1$pq7$[email protected]..
> Please forget the last post since my array was still not
correctly syntaxed.
>
> The latest corrective outputs: [object Object],[object
Object],[object
> Object],[object Object]
> And still no sounds.
>
> Latest file here:
>
http://www.mysharefile.com/v/2899615/1_as1_soundarray.fla.html
I can't look at the fla because of my old Flash version but I
looked at your posted code again.
Do you need all that array stuff for anything? I mean, if all
you want to do is play a random song every N seconds you can do it
with just a few lines of code..
function randomSound()
stopAllSounds();
var snd = new Sound();
var g = random(2) + 1; // 1, 2 or 3
snd.attachSound("s"+g); // s1, s2 or s3
snd.start(0, 1);
randomSound(); // start the first song now
id = setInterval(randomSound, 10000); // change songs every
10 seconds
Make sure you have 'linkage' names for your 3 songs (not
library names)
Your original code did play 1 song every 1 second (just makes
a popping sound when changing that fast) so I suspect that your
linkage names were missing.
I wouldn't use a recursive coding like that though. (a
function that calls itself)
tralfaz

Similar Messages

  • Xperia P: Random sound notification issue

    Hi all, sorry for my english but i'm Italian.
    Yesterday i buyed a fantastic Xperia P no-brand and upgraded to 6.1.1.B.1.54, then i wipped all data, but i I noticed that the audio sometimes does not start..sometimes start normally apparently without a reason.
    Thanks.

    All audio or is it just some specific sounds that stops working? Have you tried to reinstall the update using SUS?
    http://www.sonymobile.com/gb/tools/update-service/
     - Community Manager Sony Xperia Support Forum
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Playing random sound in array

    Hey guys,
    I'm new to AS3, still learning. I just read a little about arrays in the book I was learning from, and after looking at some online stuff, thought I'd try to do something simple with one.
    What I'm trying to do is save a bunch of sounds (different dog barks) in an array and then when I press the button, it plays a random sound from that array. Here's what I have so far :
    package
              import flash.media.Sound;
              import flash.media.SoundChannel;
              import flash.events.MouseEvent;
              import flash.display.MovieClip;
              public class Sound2 extends MovieClip
                        var bark1:Bark1;
                        var bark2:Bark2;
                        var bark3:Bark3;
                        var bark4:Bark4;
                        var bark5:Bark5;
                        var bark6:Bark6;
                        var soundChannel:SoundChannel;
                        var barkArray:Array = [Bark1, Bark2, Bark3, Bark4, Bark5, Bark6];
                        public function Sound2()
                                  barkButton.addEventListener(MouseEvent.CLICK, onBarkButtonClick);
                                  bark1 = new Bark1();
                                  bark2 = new Bark2();
                                  bark3 = new Bark3();
                                  bark4 = new Bark4();
                                  bark5 = new Bark5();
                                  bark6 = new Bark6();
                                  soundChannel = new SoundChannel();
                                  function onBarkButtonClick(event:MouseEvent):void
                                            var barkNo = Math.round(Math.random() * 5);
                                            soundChannel = (barkArray[barkNo]).play();
    When I try to press the button, I get this error message :
    TypeError: Error #1006: play is not a function.
              at MethodInfo-22()
    I used trace and saw the numbers from barkNo were fine, I think it's just something about the array. I've also spent a few hours trying to do it different ways, but still nothing. How can I play a random sound from an array? And am I storing the information correctly? I'm not sure what I'm missing, any help would be great.
    Thanks

    First, never use nested and anonymous functions - you position yourself for a lot of trouble.
    Try this (I did not test it though):
    package
              import flash.media.Sound;
              import flash.media.SoundChannel;
              import flash.events.MouseEvent;
              import flash.display.MovieClip;
              public class Sound2 extends MovieClip
                        var sound:Sound;
                        var soundChannel:SoundChannel = new SoundChannel();
                        var barkArray:Array = [Bark1, Bark2, Bark3, Bark4, Bark5, Bark6];
                        public function Sound2()
                                  barkButton.addEventListener(MouseEvent.CLICK, onBarkButtonClick);
                        private function onBarkButtonClick(event:MouseEvent):void
                                  soundChannel.stop();
                                  sound = new barkArray[int(barkArray.length * Math.random())]();
                                  soundChannel = sound.play();

  • Random sound clips

    got a pavilion d7-6bus laptop problem is  its playing unwanted random audio clips...everything from auto ads to hard rock and cooking tips ....Norton anti virus people say its not a virus...anyone out there have a solution...getting to the point where this computer gonna become part of a landfill

    Hello autodiddy,
    I see that you are having problems with random sound clips on your HP computer. I have some suggestions that may help with this issue.
    I would first suggest doing a clean boot. This will make sure that there are no software programs causing the clips to play. Here is a link that explains how to do a clean boot.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Urgent: iMovie creating movies with random sounds throughout

    When exporting my iMovie project - which I put together clips from various documentaries, muted them, and put my voice over in mp3 files... random sounds appear at various points - these are the sounds from one video that I've muted.
    The sounds do not even appear during the playing of this video - but others way before it.
    None of this shows up in the preview, and I've tried saving it as both as the highest definition - 1080p, as well as the 'tiny' movie (but even this takes 10 minutes to compile).
    The stange sounds appear at exactly the same place in both versions... I even changed a few things before the second 'tiny' export, but it was still the same.
    The original movie files were high quality, of various formats - mp4, avi, .mov, etc.
    The particular file that the audio is coming from is an mp4 file (1920x1080 originally)- it has been muted in the video, and in the Events browser.
    I downloaded this video from YouTube, via www.keepvid.com - it's called: Coral reefs and climate change- A message for Copenhagen, and can be found here: http://www.youtube.com/watch?v=8SdDiHbG1tY&hd=1
    I have restarted my computer, iMovie, everything...
    ...this video is due ASAP, and I'm not sure how to solve this irritating issue.
    I hope to hear from you!!

    There have been numerous posts about audio issues. In almost all cases, the user has used speeds other than the presets. Changing to the presets fixed the problem. It's possibly a bug in iMovie, or a less than stellar design with the slider - maybe a pop-up box would have been better.
    If you don't want to mess with your project, then duplicate it (File>Duplicate Project). Then make the changes in the duplicate.
    John

  • After upgrading to yosemite my macbook pro late 2011 does a random sound from time to time.

    After upgrading to yosemite my macbook pro late 2011 does a random sound from time to time. Its completely random and i already checked all apps in use and its not from them.

    Sounds like Notifications app.
    Maybe some other app. In SystemPreferences->Users&Groups->LoginItems tab: remove all entries with the minus sign underneath. This will not uninstall anything, you have to start those apps by hand now. Restart.
    Still there?
    Yes: Restart again while holding the shift key, this will start the mac in SafeMode: only the necessary items are loaded to run.
    Still there?
    Yes: Make an etrecheck list and post it here.
    No: Restart, put the items in the LoginItems back, one by one, restart after each entry, and you will find the "culprit"
    Please report accordingly. I will be back in 24 hours.

  • To everyone with IOS6 Sound related issues & Others

    If you are facing a problem of not having any system sounds, notification sounds, no calls or other software sound related issues I'd suggest you read below it's a stupidly simple fix and it should solve most software issues after an immediate iOS6 update:
    After updating unplug the phone from your computer and leave the phone alone for 5-10 minutes, if you still have problems: reboot, wait a few minutes and all sound related problems should be fixed.
    When I updated to iOS 6 I had lost my system sounds, so I unplugged from the computer, rebooted the phone and still no go. I decided to just let the system "settle in" for a bit, let it lock and when I unlocked after 5-10 minutes sounds were back and everythings up and running again.

    Well, to break it down. After my sounds finally came back (2nd time losing them) last night I decided to restore the phone in itunes. I did it twice. First time I backed up my data. Second time I restored it as a factory iPhone. Both times guess what NO SOUNDS! I also realized that last night I had lost my sounds after charging my phone and unplugging it from the data cord. I still have ringtones (when someone calls), but text messages, emails, and any other alert tones do not work. I cannot turn the volume up or down with the side buttons and also music does not play. It doesn't even have a slide bar at the bottom.
    I am on the phone with apple care now. They seem to not be aware of the problem at all.
    While I was on the phone with them my sounds ended up coming back, imagine that. Hopefully every time I charge my phone I am not going to have this issue.

  • Has Apple addressed poor sound quality issues with new 160GB iPod classic?

    I just bought a new 160GB iPod classic, replacing a perfectly good 80GB iPod Video (5.5), thinking that the newer one would be superior to my 3 year old model. I discovered that the sound of the new unit was flat and muddy compared to the older model. I found that the 5th gen iPod video was more "spacial", if that's an appropriate word to use; the bass was more present and more clearly defined, as was the rest of the sonic spectrum. I searched several forums to research this issue and while there were numerous references to this issue, all of the posts I found referred to the original iPod classics (80GB and 160GB) and not the later 120GB classics nor the new 160GB classics like the one I bought. Has Apple done anything to address this issue since the first classics were released or are the new ones still suffering from the same sound quality issues as the original classics?

    Based on your observations here, they apparently have not changed the sound quality since the original 160GB classic. I noticed a clear narrowing of the sound stage (ambiance) between the 5.5G 80Gb and my 6G 160GB. You're describing the same characteristic. I don't own the newest 160GB version and came here today to see if it might have improved the sound quality back to the 5.5 spaciousness. Note that the 5.5G has a higher signal to noise ratio than the 6G, making it difficult for me to enjoy it through efficient balanced armature in ear monitors like the Shure SE530s or Ulimate Ears Triple.Fi 10s.

  • Sound input issues.  Not related to Soundflower or Balance issues

    So.  With the sound flower issues fixed.  And my balance knobs in place for my stereo speakers.  I have opened up a new song I have been writing.  Again the AVIGrandpiano app was the track I was recording on.  Like my previous post from last week the input on the new music was very faint and not at all matching the input of the previous recorded music.  (See Screenshot on earlier posts) 
    I am at a loss as to where to begin to fix this. 

    Pampido wrote:
    Anyone experiencing similar issues? Or know of a solution?
    Not having any issues with my device at all.

  • Hi , I suhail khan from india and i am user of iMac system 10,1.These days i am facing the sound enabling issue with my iMac system I am not able to hear sound in my iMac system.So kindly suggest me how to enable sound in my iMac . Please no the needful.

                      Hi , I suhail khan from india and i am user of iMac system 10,1.These days i am facing the sound enabling issue with my iMac system I am not able to hear sound in my iMac system.So kindly suggest me how to enable sound in my iMac . Please no the needful.

    Take each of the following steps that you haven't already tried.
    1. If you've recently plugged anything into the audio-out (headphone) port, plug and unplug it a couple of times.
    2. From the menu bar, select
     ▹ System Preferences ▹ Sound ▹ Output
    Check the settings. The internal speakers should be selected as the output device, the Mute box should not be checked, and the volume slider should be at least halfway to the right.
    3. Look inside the headphone port. If a red light is coming from the port, the internal switch is stuck in the position for digital output. You may be able to free it by inserting and removing a headphone mini-stereo jack of the proper size.Inserting any kind of tool in the port may cause damage that won't be covered by your warranty.
    4. Boot in safe mode by holding down the shift key at the startup chime. It will take much longer than usual. You don't have to log in; just reboot as usual (without holding any keys) when the login screen appears. (Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode.)
    5. Reset the NVRAM.
    6. Reset the SMC.
    7. Reinstall OS X after backing up all data as a precaution. You won't need your backup unless something goes wrong.
    8. Make a "Genius" appointment at an Apple Store.
    Back up all data on the internal drive(s) before you hand over your computer to anyone. If privacy is a concern, erase the data partition(s) with the option to write zeros* (do this only if you have at least two complete, independent backups, and you know how to restore to bare metal from any of them.) Don’t erase the recovery partition, if present.
    *An SSD doesn't need to be zeroed.

  • IPod classic sound quality issues

    Hi guys,
    I understand probably it's too much early to discuss this topic but anyway I try to ask.
    In order to the release of the new model (yesterday's event in USA)of the classic, anybody has any news about the sound quality complaints arised in the previous months?
    I mean, anybody knows if the quality sound problems, due to the change of the sound micro-chip, have been solved in the new modelMany thanks in advance for the help.

    Excellent question, the answer to which I eagerly await. If the sound quality improves, I might purchase a 120GB, otherwise, there are now alternatives by competitors with 120GB capacity, similar form factors, built in FM radio, subscription music services, and wireless sync of the music library for the same price as Apple's 120GB. They don't have the sound stage issue as the 160GB Classic. There is even a 240GB model being offered by a competitor.
    Too bad Apple didn't release a 240GB Ipod classic. Toshiba, Apple's hard drive manufacturer, announced a 240GB 1.8" drive on 9/9, coincident with the Apple Ipod announcements. I have a large and growing library of classical recordings as I explore the classical catalog, as well as many Podcasts. I could really use the space! I've input this request on Apple's Ipod feedback page and suggest that any like minded customers do the same.

  • My iPhone was getting hot when used or charging. Went to Apple in Portland, OR.Phone making random sound. Why??? How do I make it stop????

    My iPhone was getting hot when used or charging. Went to Apple in Portland, OR. I did a reset on the phone. My IPhone is now making a random sound. Why??? How do I make it stop???? I have turned off all notifications. I do not have life360 or Skype. I do have Facebook, WordsFree, ScrabbleFree, Pandora.

    I did the reset. I updated the iPhone to 6.0. The alert sound stopped for a while then started again. I had to go to notifications a few times to turn off some of the alerts and now I have peace, plus I learned more about the notifications. Thanks for your help. I did not need to go to the Apple Store.

  • Random an Array of integers

    how can i random an array of int's ?

    int RandomArray[] = new int [155];
    for ( int i = 0 ; i <=29 ; i ++ ) {
    RandomArray[i] = 1 ;
    for ( int i = 30 ; i <=86 ; i ++ ) {
    RandomArray[i] = 2 ;
    for ( int i = 87 ; i <=123 ; i ++ ) {
    RandomArray[i] = 3 ;
    for ( int i = 124 ; i <=154 ; i ++ ) {
    RandomArray[i] = 4 ;
    an array of 30x 1 , 57x 2 , 36x 3 and 30x 4
    i want to random the array and but it in a stack so i can get one by one and directly remove the top one who is taken
    i hope this is enough information
    thx

  • Random sounds playing from Macbook unprompted

    My Macbook Pro is playing random sounds when it is not being asked to.  Computer on right now, with no music playing and very short snippets of sound (2 seconds at most) are playing out the speakers - trying to identify them they are not parts of songs I have (iTunes is not running right now) but sound like the sonic element of a video that is buffering.  The biggest segment I heard just a few minutes ago where an American lady said quite a few words (sounded like an infomercial).  It's happening maybe every few minutes, but not at regularly timed intervals.
    Sounds sort of like trying to tune a radio and only catching snippets of sound (but less regular)
    Currently running - google chrome, finder and messages.
    Also open Dropbox, Copy, Evernote, f.lux, Gdrive and Twitter apps.
    MacBook Pro (Retina, 13-inch, Late 2013) / Running Yosemite 10.10 (I'm not 100% sure but I think this problem started before Yosemite upgrade)

    HI and Welcome to Apple Discussions...
    Random sounds playing.
    Check your Dashboard widgets. You might have something running ...
    Carolyn

  • HT6030 Sound output issue with Mavericks

    There is a sound output issue with Mavericks and Firewire800 Audio devices. I am using a MIO 2882 but now people are having issues with other devices as well. Is this something that will be addressed in an update? If not I will need to downgrade my OS.

    maybe the adapter went bad.....fast. try getting one thats made by sony. or apple. i have had bad luck with some cheap products i bought.
    or maybe thats the brand you have ad luck with. i remember when i use to get some quantom fireball drives, and they just died on me the next week. im down to two and keeping a good eye on them. especially fujitsu. the only ones i have GREAT LUCK with are Seagate and Western digitals drives.

Maybe you are looking for

  • Oracle Payables - APXIIMPT  - Invalid Sequence rejections

    Hello Guys: My Business users are complaining that they are getting lot of rejections while running APXIIMPT ( Payable Open Interface Report for Invoices) due to invalid sequence error. We logged a TAR with oracle and I am not getting any where after

  • Stock ageing report in inventory management

    Hi, iam working in stock ageing report my requirment is i for developing stock ageing i have chars for plant and material ,and other 2 chars but i dont have cal day i have only creation on date means posting date only availble .my current layout is :

  • Download data from memory to Excel format.

    Hi Gurus,     How can I download data from Memory( not in application server ) to Excel format ? Now I am using below function modules  but not coming in proper format. CALL FUNCTION 'LIST_FROM_MEMORY'        TABLES             listobject = listobjec

  • Regarding Crystal Reports 2008

    Post Author: Swathi Godavarthy CA Forum: Data Integration Hi, Right now we are using crystal reports X1 release2 with RDC. We are not using crystal rpeorts integration with .Net rather we are using activex viewer. We are integrating crystal reports w

  • Video Support in Web Gallery Creation

    You can select images in bridge and produce an html web gallery out of them, but what about a flash video website?