Sound Button, ActionScript 3.0

Hi, I am a newbie to ActionScript but I do have an understanding of scripting. I have worked in designing games on a few game engines and now I am looking into ActionScript 3.0
I created a script by getting some details here and there on the web and this is what Ive come up with,
var loadSnd:URLRequest = new URLRequest("Sound.wav");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);
Sound_1.addEventListener(MouseEvent.CLICK, playF);
function playF(event:MouseEvent);void{
          thisSnd:play(); //Line 8
Output:
Scene 1, Layer 'Actions', Frame 1, Line 8
1084: Syntax error: expecting rightbrace before semicolon.
I dont think this is a difficult error to fix but it is an issue for me at the moment.

another error in your code:
kglad wrote:
use:
var loadSnd:URLRequest = new URLRequest("Sound.wav");
var thisSnd:Sound = new Sound();
thisSnd.load(loadSnd);
Sound_1.addEventListener(MouseEvent.CLICK, playF);
function playF(event:MouseEvent):void{
          thisSnd.play(); //Line 8

Similar Messages

  • Help with multiple sound buttons?

    Is there any way I can have multiple sound buttons that works as stop buttons for each other?
    I mean.. I now got 3 buttons that start 3 different songs, but they overlap each other when I press more than one. I'd like Song 1 to stop when I press Song 2 or 3. And vice versa
    I'm trying to make learning tools for autistic kids so helping me is helping them . I'd really appreciate it. Thanks

    Thanks! Is there any way to do it without using actionscript?
    The sounds are simply connected to the buttons through Properties

  • InDesign interactive pdf sound button

    I have created an InDesign file with sound buttons on each page and exported it as an interactive pdf. A button is pressed to activate a short mp3 that has been placed on the page. The sounds are recycled from another project and well in that swf.
    The problem is that the button in the pdf file needs to be pressed twice to play the sound when clicked the first time and only one click to play the sound again. I have used both on Click and on Release. The behavior is the same. What's going on here and how do I correct it?
    This is part of an educational materials project and we are very picky about our products.
    Thanks

    There is a solution to this problem. I mentioned it to my senior SE significant other and he know the answer right away.
    In the button panel, when you add the sound button action to the button, you also add the Focus(pdf) action as well. This solves the double click issue.

  • Help with simultaneous on off sound buttons

    hi, I'm an intermediate flash user and I've made a file for
    my kids in class that has some sound on-off buttons. they are set
    to play once or loop depending on length by simple mouse click.
    they will play simultaneously if more than one is clicked
    individually on the page. I'm trying to make the page so the kids
    can just select the sound button icon, drag as many of them as they
    want (usually 2 -4 sounds at a time) into a box at the bottom of
    the page where they will then just play and loop. if they are
    dragged out of the box, that sound will stop. if another is dragged
    into the box it's sound will then join the ones that are already
    looping. can someone please help point me to the action script I
    need to write for this to occur? thanks. please email me at school:
    [email protected] if you can.

    yes, using the linkageID will allow you to start the sound
    associated with each icon.
    so, if you have an icon with instance name drumsIconMC and
    you have a sound in your library that you've assigned a linkage id
    of drumsID, you can use:
    drumsIconMC.soundID = "drumsID";
    drumsIconMC.onPress=function(){
    this.startDrag();
    drumsIconMC.onRelease=function(){
    this.stopDrag();
    if(eval(this._droptarget) == boxMC){ // assuming your drop
    target box is named boxMC
    if(this.s == undefined){
    this.s = new Sound();
    this.s.attachSound(this.soundID);
    this.s.start(0,999); // <- asssuming you want to loop your
    sound 999 times
    } else{
    if(this.s != undefined){
    this.s.stop();

  • My sound buttons keep stopping working and when I click onto a video it doesn't even have the little slider that you use to turn the volume up. What is wrong with my phone?

    My sound buttons on my iPhone 4S keep stopping working, even wen I use the switch to turn my phone on loud it comes up and as soon as I hit a volume button it disappears! Also when I am on a video on Facebook etc the volume slider isn't there?

    You need to re install OSX. If you have the dmg file downloaded via torrentz this is how you can create a bootable external HD or Flash drive (8 GB+)
    https://discussions.apple.com/message/23957654#23957654
    Peace
    Harry

  • APPLE MACBOOK PRO SOUND BUTTON ISSUE

    Why doesn't my sound button respond on my macbook I have even reset the PRAM

    Sorry man ok so here is the issue sometimes my audio is really weird like the f10 f11 and f12 keys dont work and Sometimes when I put headphones in I cant control the sound using the buttons or the sound icon on the top bar
    there is no red light I have checked the sound preferences I have reset the PRAM what seems to be working is when I slowly insert headphones in and out of the jack I bought this thing mid 2010 so im not covered by apple care and I hate that it costs $19 just to talk to them and I dont feel like spending $700 on a new logic board I bought this to escape my awful microsoft experiences so do you have any other ideas on this sound issue if you do that would be awesome and If I need to post a video of the issue I will thanks
    ALSO im using the macbook pro 13 inch and this seemed to happen after I downloaded some bamboo tablet software

  • Sound button stops working intermittently

    Sound button just stops working.

    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select "Reset Firefox", just use "Start in Safe Mode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

  • Sound buttons and mute switch not working

    My iPhone 4 has no sounds through the phone speaker except when I play music. It works fine through a dock or bluetooth in my car.
    Also, the side 'sound buttons' do not work. ie - when I switch the mute switch to either on or off (and it becomes orange) nothing shows on the screen, also when I push the volume buttons up or down, nothing comes up on the screen.
    I have tried: turning it on and off, resetting it, cleaning the charging port with a dry brush, checking the settings to make sure it should be playing sounds, inserting head phones a few times.
    I have recently updated to the new 6.1 iOS update, but it was doing this before I updated it.
    I can't think of anything notable that happened when it started doing this a few days ago. Seems random...
    Also, my iPhone has had sound problems before (speaker crackling and not working) but the side buttons still registered on the screen, and also I could fix it by charging it.
    Anybody got any handy hints?? Cheers.

    It's ok, I fixed it.
    I got an iPhone 5. Bravo to apple for making me buy another one of their products.

  • HT1338 on my macbook my one button delete botton sound buttons and escape doesnt work i updated everything and it still doesnt work what do i do

    on my macbook my one button delete botton sound buttons and escape doesnt work i updated everything and it still doesnt work what do i do

    Unless somebody else has a micracle workaround I don't know.  Probably get the phone in for repair since it has been living on borrowed time so far and now you absolutely must have a working button.

  • Problem with sound buttons on keyboard since upgrading

    Since my upgrade to Mavericks the sound buttons on my keyboard F10,11,12  no longer work. When I press the buttons to either increase or decrease sound, the page I am on disappears from the screen and the mute button diminishes the page but there is no change to the sound.  Any suggestions?

    Thanks for your reply.  I tried your suggestion but I came across this sentence:
    OS X does not store network settings in NVRAM / PRAM. If you are troubleshooting a network issue, resetting it will not help. 
    I am not very technical, I did try some options but I am afraid I couldn't get it to work. :-(

  • Alarm sound button is greyed out in Iphone 5, can you please let me know how to activate it?

    Under Alarm -  Sound button is greyed out in Iphone 5, can you please let me know how to activate it?
    I m not able to select other tones for the Alarm since it's greyed.
    The phone literally hangs and I had to come out of the screen by pressing the home button.

    Hi Mahendra KK,
    If you are having issues such as you describe with your iPhone, I would suggest using the steps in this article to troubleshoot -
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • Dedicated sound buttons have no eff

    Hi guys,
    I just bought a Xfi ExpressCard Sound Blaster. When I choose the selection "enable audio playback through notebook speakers," my dedicated sound buttons on my laptop (mute, increase/decrease volume) do not work at all.
    Like, if I'm watching music on youtube... if I right-click the speaker on the toolbar and choose volume mixer, I see three parts: devices, window sounds, and youtube. If I press the mute button for the device part, the youtube video will continue playing. however, when I press the mute for the youtube (on volume mixer), the mute will work.
    I just want my dedicated audio buttons to work when I choose the enable audio playback through notebook speakers. If I don't select it and listen through my headphones, then?the buttons will work...
    ?thanks

    Hi there,
    I hate to bring you bad news, but this is a known issue with no known fix. Well, I don't know whether Creative has acknowledged it as an issue or not, but its been posted several times on these forums, without much response. I've been in circles with their tech support on this.
    There are a few things you could try, and these are the things that Creative will suggest:
    . Make sure that the Sound Blaster is the default sound device
    2. Try disabling the onboard sound device in the BIOS and/or in Windows (via Device Manager and/or Sound Control Panel applet)
    3. Uninstall the Creative X-fi software and reinstall in Safe Mode (and then make sure that you update it)
    If you happen to have a Dell XPS M530, don't bother with the above; it's what I have. If it isn't this model, what computer do you have, and what is the onboard sound device? I'm curious whether this might be partly Dell's and/or SigmaTel's fault, or if its more general than that.
    Here's what's happening, as far as I can tell: When you enable playback through the notebook speakers, all your volume controls modify the volume of the X-Fi device. You'll note that, in this situation, if you go into the (I assume you have Vista?) the Volume Mixer and change the device to the onboard sound device to show its volume slider, modifying that one will work. So the sound is really still coming from your onboard sound device, and if you watch in the Sound Control Panel applet when sound is playing, you may see activity on both the X-Fi device and the onboard device. You may also note that the card's special effects don't work in this mode either.
    Now, this is why they recommend to disable the onboard device, but on the XPS M530, the speakers will not work at all with the onboard device disabled, and the Creative software will tell you that when you try to test playback through notebook speaker.
    I wish I could help. I'm going to continue to press on the Tech Support front, maybe ask to get escalated. I'll update you if I can get anywhere.
    Message Edited by DakkonA on 06-7-2008 0:33 PM

  • Why won't the sound buttons work on my HP Pavilion g series?

    for some reason the sound buttons UP, DOWN and MUTE will not work on my laptop.  even when i plug in the headphones it does not work.  HELP!

     Hi,
    Try the following.
    First, download the Flash uninstall utility on the link below and save it to your Desktop.
    Flash Player Uninstaller.
    When the download has completed, close all browser windows and run the uninstaller.  After this has completed, restart the notebook.
    Next, download and install Firefox and then using Firefox, download and install the latest version of Adobe Flash.  Note: You may want to deselect the option to include McAfee Security Scan Plus before downloading.
    Close all browser windows before running the Flash installer.
    Launch Firefox and see if videos etc play Ok in this browser - if they do, close Firefox, open Internet Explorer and click on the same Adobe Flash link above to get a prompt to install the ActiveX component.  When done, restart Internet Explorer.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • My sound button cant function even the sound also not sound but when i received call, it do ring..just when i try to play utube or play music it will never have sound...please help me. now i'm using ios7. It just recently happened.

    My sound button cant function even the sound also not sound but when i received call, it do ring..just when i try to play utube or play music it will never have sound...please help me. now i'm using ios7. It just recently happened.

    Hi hayscart,
    This article contains steps to try when you are having trouble with the iPhone's speaker:
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/TS1630
    Cheers,
    - Ari

  • Sound button no longer adjusts sound level properly

    Since upgrading to 4.02 on iPhone 3GS I have had sound issues. The sound button on the side of the phone does not adjust the sound level at all. The only way to fix it is to adjust the sound level from the sound settings menu. This seems to temporarily "reset" the sound button so it works properly once again. However the issue does not go away. This happens at least once a day. Restoring the phone as a new phone does not work either. Anyone have the same issue?

    Mine is really low volume now, set to max but sounds like its on minimum.. Ive even replaced the speaker module but still the same, all stems from OS4..
    Hopefully wednesdays release of 4.1 will cure this!!

Maybe you are looking for

  • Idoc ORDERS05

    Hi all, I have requirement based upon Idocs. SInce I am not very experienced in IDoc I am seeking experts advice . I am pasting my requirement. Can anyone please explain me how do I approach with this : <b> There needs to be logic added to IDoc type

  • "Network" in Finder opens then closes-still!!!

    I was hoping that this bug would have been attended to in one of the many "upgrades" to Tiger. Now we have 10.4.4, our expectations rose, only to be dashed yet again. Does anyone know why this happens and more importantly how to fix it apart from reg

  • Wrong german umlauts

    Hi, we are using PI/7.0 and a customer uses XI/3.0 - we have the same SWCV installed on the machines. The solution sends mails via java-mail  - not via mail adpter of XI/PI. We are sending IDocs from R/3 to XI and the solution sends mails via java-ma

  • Fpga - trying to use the RIO Replication VIs to replace Run at Reset Running FPGA

    Running LabVIEW 12.1 We have an application that is using an FPGA that was compiled to Run at Reset (runs on any reset or powerup).  We occassionally need to update the image on the RT and FPGA and I have downloaded the NI RIO Replication VIs. The pr

  • Some questions about view options for single folders

    hi, I'm trying to customize the finder a little, but I'm running into some troubles. It seems that finder is not capable of saving view options for single folders, is it? What I mean is: For example I want my standard view to be "column view, sorted