Sound issues in a replay and....

Below is code for a simple game that has music that starts as soon as the game scene is reached....third scene. There are 4 buttons associated with the music, volume up, volume down, stop music,  and play music.
As I said the music plays automatically at the start of the game, which I want. The up, down and stop volume work. The problems are.
First, if you stop the music the play button will not start the music again.
Second, none of the sound buttons work on a replay.
Would it help to have a link to the game? I will up load and put a link in in a few minutes.
I am stuck. I am new to actionScript. I am taking a class and the project is my final. I look forward to the day when Action
I appreciate your help!
Thanks,
Michelle
var bool:Boolean
var score: Number = 0;
var flag:Number = 1;
var myTimer:Timer = new Timer(1000);
var soundReq:URLRequest = new URLRequest("music.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var volumeControl:SoundTransform = new SoundTransform();
var flag2:Number = 1;
count_txt.text = "0";
myTimer.addEventListener("timer", timedFunction);
insect_btn.visible = false;
timer_txt.text = "20";
function disappear(e:MouseEvent):void
    if (timer_txt.text == "0")
        launch_btn.removeEventListener(MouseEvent.CLICK, target);
        insect_btn.removeEventListener(MouseEvent.CLICK, disappear);
    else
        insect_btn.visible = false;          
        count_txt.text = String(++score);
function target(e:MouseEvent):void
    if(flag==1)
        myTimer.start();
        flag = 0;
    insect_btn.x = Math.random()*625;
    insect_btn.y = Math.random()*475;
    insect_btn.visible = true;  
function timedFunction(e:TimerEvent)
   var tc:int= 20 - myTimer.currentCount;
    timer_txt.text = tc.toString();
    if (myTimer.currentCount >19)
        insect_btn.removeEventListener(MouseEvent.CLICK, disappear);
        launch_btn.removeEventListener(MouseEvent.CLICK, target);
        myTimer.stop();
        gotoAndPlay("done_frame");
function playAgain(evt:MouseEvent):void
    gotoAndPlay("play_frame");
if(!bool){
bool=true;
sound.load(soundReq);
soundControl = sound.play();
function playSound(event:MouseEvent):void
           if ( flag2 == 0)
            soundControl = sound.play();
            flag2 = 1;
function stopSound(event:MouseEvent):void
    soundControl.stop();
    flag = 0;
function increaseVolume(event:MouseEvent):void
    volumeControl.volume += .5;
    soundControl.soundTransform = volumeControl;
function decreaseVolume(event:MouseEvent):void
    volumeControl.volume -= .5;
     if (volumeControl.volume >= 0)
        soundControl.soundTransform = volumeControl;
    else
        volumeControl.volume = 0;
insect_btn.addEventListener(MouseEvent.CLICK, disappear);
launch_btn.addEventListener(MouseEvent.CLICK, target);
btn_play.addEventListener(MouseEvent.CLICK, playSound);
btn_stop.addEventListener(MouseEvent.CLICK, stopSound);
btn_up.addEventListener(MouseEvent.CLICK, increaseVolume);
btn_down.addEventListener(MouseEvent.CLICK, decreaseVolume);

The sound control buttons are available for the entire timeline. Other than when I went to turn in a different project today I have been playing with this problem.
Can you see anything wrong with the AS below? The only thing I can think of is it has to be a typo of some sort.  I gone over it so many times I don't think I even see it anymore.
function handleClick3(e:MouseEvent):void
    if ( e.target == btn_again)
    gotoAndPlay("play_frame", "game_scn");
btn_again.addEventListener(MouseEvent.CLICK, handleClick3);
I just got this error code.  It happened when I click more than once on the sound button during the replay. I havn't had much success when I google these errors. I will do that next. But just in case you recognize it. Here it is:
ArgumentError: Error #2068: Invalid sound.
    at flash.media::Sound/play()
    at find_the_butterfly_fla::MainTimeline/playSound()

Similar Messages

  • Has iOS 6.1.3 fixed speaker  / sounds issue with iphone 4 and 4s?

    updating to iOS 6.1.1 or 6.1.2 cause external speaker not working on iphone 4 and iphone 4s.

    Hi there,
    I'm writing from Switzerland.
    I got the same issue since iOS 6.1.1 or 6.1.2 and expected improvement with iOS 6.1.3...but I still have the same problem.
    Additionnaly I can no more listen to music when I plug my Iphone 4s on a dock station of logitech speaker.
    Before iOS 6.1.1 all worked well.
    Just to know, do you use the itubes apps?

  • Sound issue on iphone 4 - 7.1.1

    My mom has an iphone 4 that was handed down to her from my sister.  After one of the ios updates...can't remember which one...the phone stopped giving audible notifications for text messages.  As I have tried to troubleshoot this issue I have discovered the other following problems:
    The phone will not play music on any speaker.  I was trying to connect the phone via bluetooth to a speaker bar and when I tried to play pandora, I got nothing.  I then disconnected the bluetooth to see if I would get sound out of the phone's speaker and got nothing.  I attempted to play a downloaded song and got nothing.
    I then tried to see if I could find other issues and I did.  When I go into settings>sounds>ringtones I can switch ringtones and hear the ringtone sample.  When I go into settings>sounds>text tone, I can select any tone in the list and all I get is a vibration, no sound at all from any of them.
    I also found that when pressing the volume up and down buttons on the side of the phone do not produce the pop up box that shows volume going up and down
    I believe these three problems to be related as some kind of systematic software bug.  Can anyone confirm this or offer a possible solution. Keep in mind the phone does make sounds when someone calls also from the speaker phone.  The only non-sound issues are text notifications and playing music.  I find this to be a rather important problem because the phone can really no longer be used as a phone since my mom continually misses text messages because she does not get an audible notification.

    Hello hiknmt06,
    You may need to restart or reset the device.
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Should the behavior continue, it may be necessary to restore your iPhone.
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/HT1766
    Cheers,
    Allen

  • T400 Sound Issues

    New T400 - 7417TRU....random sound issues...comes and goes.  Running XP.  For example, while listening to a CD, sound comes and goes and then starts warbling.  Any ideas?
    Solved!
    Go to Solution.

    we are also having random touchpad mouse issues.  seems to have a mind of it's own.  This unit was purchased Mid-March 2009.  Went into the settings for the touchpad and basically turned all special features off.  Still does it...randomly...not all of the time.
    Solved the problem by downloading and installing DVD Firmware update from Lenovo.  For the mouse touchpad issues, went into the settings and turned off all settings, leave the touchpad in basic configuration.  All is working great now.
    Message Edited by mark97 on 06-01-2009 07:03 AM

  • VOIP Sound Issues

    Hi I have a new MacBook Pro and am experiencing terrible sound issues with both iChat and my VOIP. I use a belkin router for the Linksys modem from Verizon.
    1. Will speakers help with the iChat Sound
    2. What router do you recommend for VOIP. Will Airport Extreme work?
    3. Any tips for getting this working right?

    Please describe your sound issues in more detail. What exactly do you hear or don't you hear?
    Could it be a right speaker distortion as described in this thread?
    http://discussions.apple.com/thread.jspa?threadID=388368&tstart=0

  • Small "freeze" and sound issue when taking a full screenshot

    Hello,
    This is a strange one, and I've not been using Macs properly for very long, so bear with me
    It only happens when I use cmdshift3 to take a full screenshot, the other shortcuts for taking them are fine, I do get a similar issue when using Grab and it, too, only occurs on the full screen capture. What happens is, the sound clip of the camera noise will begin to play, stop, it goes a little distorted then the windows on screen will freeze up, the mouse will still move, and it stays like that for around 5 seconds until the file is saved to the desktop and all goes back to normal again. I'd like to reiterate that it only does this when i do a full screenshot, and the smaller one with the crosshairs and the individual windows is perfectly fine.
    I tried searching on google, on the main support section and the forums and nothing has come up that's been helpful. I've had a look in the system logs, and at the time's I take the screenshot, the system log reports the following:
    Sep 24 14:04:09 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - Error: attempting to clip to a position more than one buffer ahead of last clip position (2,728)->(3,7bd).
    Sep 24 14:04:09 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - adjusting clipped position to (3,728)
    Sep 24 14:04:32 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - Error: attempting to clip to a position more than one buffer ahead of last clip position (2,71a)->(3,7ec).
    Sep 24 14:04:32 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - adjusting clipped position to (3,71a)
    Sep 24 14:04:33 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - Error: attempting to clip to a position more than one buffer ahead of last clip position (4,73a)->(5,7c8).
    Sep 24 14:04:33 xxxxxxxx-computer kernel[0]: IOAudioStream[0x4db4a00]::clipIfNecessary() - adjusting clipped position to (5,73a)
    I know from that it's referring to my soundcard and there's a memory reference, but that's about as much as I can figure out.
    It might not seem a big issue as the other methods are ok, but if it turns out to be something much deeper I'd like to try and fix it now before it becomes a problem.
    Does anyone have any ideas?
    Thanks,
    Claire

    Bingo! EXACT same problem here! It seems to me its a software bug.. ??

  • I am having sound issues with Pottermore while using Safari 6.1. I once muted the sound and now can't unmute it even though the icon tells me it's unmated. I can hear samples of audio books in the store section.  Any ideas?

    I am having sound issues with the website Pottermore while using Safari 6.1. I once muted the sound and now can't unmute it even though the icon tells me it's unmuted. I can hear samples of audio books in the store section.  Any ideas? I have reset Safari.  Website works fine on Firefox.

    I am having sound issues with the website Pottermore while using Safari 6.1. I once muted the sound and now can't unmute it even though the icon tells me it's unmuted. I can hear samples of audio books in the store section.  Any ideas? I have reset Safari.  Website works fine on Firefox.

  • Sound issues; slow response; usb ports unreliable and sd reader not working

    The PC is a HP TouchSmart envy about 18 months old. Soon after purchasing I upgraded to Win 8.1.
    About three or four months -ago probably after a Win update was installed- I began to have Sound issues (including not able to conect my external powered speakers any more- they used to work brilliantly and initially no sound at all but I went into settings and changed something and every now and again I have to do that again to get the PC speakers to work) ; slow response; usb ports unreliable, sd reader not working- as well as issues with the internet - the modem actually. It is easier to get on to a tablet and use the internet as my PC can be really slow. As well I have uninstalled Chrome and am using Explorer as this seems a little better but I miss Chrome.
    I was advised by tech at Hervey Norman that I had to do a complete system restore but in order to do that I would need the recovery discs from HP? Is that correct? How do I do this?
    PS I did not make recovery discs when I first purchased the machine. (Very sad!!!)
    Help!!!
    Alfriston

    Hi again Alfriston,
    Thank you for the clarification!
    To return your computer's audio back to functional order, I recommend removing the audio driver from the operating system previous to upgrading to Windows 8.1, and installing the driver provided in this link. 
    If re-installing the driver does not resolve the issue, I suggest following the steps in this document on No Sound from the Speakers (Windows 8).
    In regards to the USB ports, I recommend following this resource on Troubleshooting USB Connections (Windows 8), which should help consistently connect your USB devices to your computer.
    To prevent your computer from lagging or responding in a slow manner, please follow the step in this document on Resolving Slow System Performance (Windows 8) to help improve the speed and efficiency of the operating system.
    To further diagnose the issue with your desktop's SD card reader, I recommend following this resource on Using and Troubleshooting Memory Card Readers (Windows 8).
    If your desktop still experiences issues with the audio, USB connections, speed and performance, as well as the SD card reader, I recommend returning your system back to a previous restore point. This can be done by following the steps in this document on Using Microsoft System Restore (Windows 8).
    Should the problem continue, I suggest performing a backup and recovery of your operating system. This can be done by following the steps in this resource on Backing Up Your Files (Windows 8), as well as Performing an HP system recovery (Windows 8). This should return your system back to factory defaults.
    If the issue persists, please call our technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region.
    http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    I hope this helps!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • Satellite A665 beeping and sound issue

    I have a Satellite A665 and when I start the computer, there is a long high pitched beep initially and then as it goes for a short time through the start up process, prior to Windows, it beeps again.  The beeping is coming from the bios, I believe since I have uninstalled the sound components in Device manager to test this.  Once Windows 7 is completely booted up and the sound components are reloaded, the speaker icon vibrates and has a continuous loud hum.  It is a high pitched hum that never goes away and the icon vibrates like crazy.  I have reseated the RAM and am at an impasse as to what to do.  It does sound like a BIOS issue but not sure what the next step may be.  It is 2 years old and out of warranty.
    Thanks!

    I have not tried updating the bios since the sound was so severe I doubted that would help but I may try that. 
    I uninstalled all sound devices in Device Manager and then rebooted and the sound was unchanged.  That is what leads me to believe the issue is not with the sound devices.  I had the speakers unplugged and the devices uninstalled and the sound remained unchanged.  The only part the sound system plays in all this is that the sound icon (little speaker in the lower right hand corner) vibrates like crazy once Windows boots up and the devices are reloaded.  If you turn up the sound on the speakers, the hum or beep is constant and gets very loud.
    I have been repairing computers for over 40 years and I have never seen anything like this.  Any help would be greatly appreciated!

  • Pixelated Graphics and Sound Issue (Gt70 2pc dominator gtx 870m)

    Sup.
    Bought my first MSI gaming notebook a couple days ago. It's fairly nice but it seems I'm having a couple issues.
    First:
    Sound issue. I have a Turtlebeach Z22 headset. When using it on my MSI laptop I get a series of pops every couple words.    The Z22 uses both usb and aux for the mic/headphones and I have tried everything from swithcing jacks, usb ports, updating drivers and playing around with realtek settings. No dice.
    Second: For some reason in game cutscenes have a lot of pixelation.
    I have tried crysis 2 and farcry 3 so far on max settings. Any sort of cutscene that uses a video clip (like Farcry's video tutorials) has a lot of pixelation and is sometimes fuzzy. The games are usually fine for the most part. I have updated my gfx drivers played with gfx setting and set launching options to Nvidia as global.
    Any ideas?

    1. Quote from: sidtheviciousyt;112316
    When using it on my MSI laptop I get a series of pops every couple words.
    Do you mean the pop sound? It would be better if you can share a video or sound record of the situation.
    2.
    Quiet manay people talk about the issue, try to change the game setting to improve the situation.
    Crysis 2
    https://www.youtube.com/watch?v=5vGD-zSyE9I
    Farcry 3
    http://steamcommunity.com/app/220240/discussions/0/846940248862985794/

  • RAM Preview framerate and sound issues

    The same story as usual. A beginner who can't get the framerate right or the sound to play in the RAM Preview. Well then:
    Ae CS6.11.0.0378, I think
    Demo version
    7,9 g ram allocatable
    Win7 proffesional
    Only .avi and .mp4, can't tell much more than that
    All other common factors can think of vary between the layers, with no difference.
    Sound preview set to 10 minutes
    No mute-related settings activated
    Sound and volume checked for each individual layer
    I don't know what more to submit, there's probably a lot.
    It's quite simple. No sound in the RAM preview, and it keeps freezing, not responding when I start it,  and playing at random speeds. The sound does play in sound preview. The framerate is set to auto.
    That's about all I can think of. It probably needs a lot more detail required, but not anything I can think of.  Any help appreciated.

    You can get the frame rate right by dragging a clip in question onto the Make Comp icon at the bottom of the project window.
    If you're fooling around with time -- time stretch, time remapping, posterize time, time displacement -- or using Rotobrush or Warp Stabilizer -- you should know that AE doesn't like mp4's as the source video.  No telling about the avi.
    There could also be compressed audio in the video files, and AE has never played nice with compressed audio.

  • I have an iPhone 4s.  After upgrading to iOS 6 (and 6.0.1) my sound occasionally just stops working and I have to power off/on to get it back working again.  Anyone else having this issue?

    My sounds occasionally stops working after upgrading to iOS 6.  Is anyone else having sound issues with iOS 6 or greater?

    I am having this same issue on my iPhone 4. The most recent update to iOS 6.1 didn't fix it either. Has anyone found a fix for this problem? It doesn't happen often, maybe every third day or so but requires power off, power on to bring the sound back. 

  • HP Envy 4-1215dx Sound Issues

    Hi, I own an HP Envy 4-1215dx. It's a great unit overall, but I am having problems with the audio on it. From the day I took it out of the box it will randomly spew out quick bursts of buzzing/crackling/digital noise whenever I try and play some sort of media, it will appear to have stopped for a while but then start doing it again, it is quite intermitten. It does it with sound from the internet such as youtube, playing MP3's, and even in Games. It is extremely irritating and I need to find a solution. I have already uninstalled and reinstalled the audio drivers and have had no luck. Doing a quick google search, I found out that there are several other people with the same problem, yet the only answer they get back is to reinstall the drivers. I have done this already and it does not fix the problem. Any help would be appreciated.
    Thanks!

    Hello Livingedge,
    I understand that the driver is an older version. This is the version that is available for your specific product on the HP Driver & Software page. I have been able to locate a driver that is also IDT, but the release date is 2013-09-30. I have included that driver here for you 'IDT High-Definition (HD) Audio Driver'.
    If this driver fails to resolve the sound issue, I would keep an eye on the 'HP Driver & Software' page. This is where if and any updates are available, will be provided here.
    Thank you.
    I worked on behalf of HP

  • Since the Mountain Lion OS update today I've had issues with internet connection and e-mail, has anyone else?

    Since the Mountain Lion OS update today I've had issues with internet connection and e-mail, has anyone else?

    That's what I would have thought, but even after saving the setting, as soon as I shut down my computer or log out of Mail, it automatically defaults back to 25. It's a bit frustrating.
    Now I just need to figure out how to get rid of those horrible pop-up banners but still have my glass sound and number of emails in the red dot when I get an email...
    These little tweaks are the only thing I HATE about upgrading my OS.

  • Strange sound issue on iPad2

    my mom is having odd sound issues on her iPad 2 that i was able to somewhat fix. and it goes from fixed back to broken o.O
    i thought it was interesting and worth mentioning, in case this happens to anyone else.
    her iPad 2 is up to date on the latest iOS (5.0.1) and the issue occured while she was watching a video in YouTube. sound is totally off in all apps. in Settings>General under 'use side switch to' it is set to 'mute'. when going to Settings>General>Sounds the volume control for ringers will work and cause the ringtone to play, so it seems the speaker itself is fine. however it will only work there and for that short time. afterward sound will continue to remain off. the volume control on the side of the unit will bring up the on screen speaker icon, except it doesnt show the bar that usually goes up and down with the volume. and sometimes at the top of the grey box it will say 'sound effects'. ive also tried switching the mute on and off which changes nothing.
    the one thing ive found that changes anything is the multi tasking bar volume control (double clicking the home button and then sliding all the way to the left, where it shows a screen orientation lock, brightness slider and a volume control bar). now the volume control bar is unfilled and doesnt show the dot that you can slide up and down to change the volume. however when i plug the iPad 2 into a computer (any computer seems to cause this) the volume control bar will suddenly fill and the dot will appear. now suddenly sound works in all apps and will change with the side control again as normal.
    now heres where it gets even weirder!!!
    sometimes when unplugging the iPad 2, after a short while volume will slowly fade out and be unresponsive again. the side buttons stop working and the volume control in the multi tasking bar will be unfilled and unresponsive. repeatedly plugging it in, going back to the multi tasking bar volume control and unplugging will eventually bring volume back. a couple times ive gotten volume to stay on and the volume bar to stay responsive by unplugging it while im in the multi tasking bar. but sometimes this is not the case.
    for the record, ive tried 'turning it off and on again' and resetting all settings and erasing all content and settings (both with starting up from a back up on iCloud and PC, and starting up as a new iPad). ive used two different laptops, one with Windows Vista and one with Windows 7. the iPad is synced with one laptop but aside from using iTunes to back it up and for charging, ive not made any changes to the iPad using these devices. during the entire duration of my attempts to fix it, the iPad has been on no lower than 80% power. ive also called Apple and discussed this with an Apple Care representative. who suggested all the same things id already done, and walked me through all the fixes to make sure i didnt skip anything.
    hopefully and most probable is that its just an issue with iOS 5.0.1. i also have an iPad 2 thats up to date with 5.0.1 and ive not had this issue, YET.
    i just thought it would be beneficial to the community to share this issue and get word out that this is happening. i would like to hear everyones thoughts on this issue and if this has happened to anyone else. the Apple Representative that i spoke to had not heard of or had to deal with this issue so it sounds like its rather new or rare. though she did mention that this is not normal behavior for the device and might be a software issue.
    id like to conclude with my love for Apple, and how user friendly iDevices are in general. ive had iPods from the very first generation and all of them still work (though the older ones cant be updated past a certain iOS). the few issues ive ever had were easily fixed with a visit to the Apple Store or searching on the Apple Support Communities. so as with before, i will remain positive and look forward to a bug fix in the next update.
    -thanks in advanced for reading, and any comments
    Paper_Dragon

    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

Maybe you are looking for