Play a sound when what frame is entered

Hello

I have the following code:

var mySound:Animal = new Animal();

addEventListener (Event.ENTER_FRAME, playSound);

function playSound(e:Event):void

{

mySound.play ();

}

It sort of works, single image / milliseconds of sound plays constantly. I want the full sound played only once.

What should I change?

Thanks for the help in advance!

Nine

this noise will loop only if mySound looping or which frame is entered more than once.  If loop mySound, sound editor allows you to remove the loops (and flash has a rudimentary editor that can simulate this.)

If this framework is entered more than once, use:

var mySound:Animal;

{if(!mySound)}

mySound = new Animal();

mySound.play ();

}

p.s. Please check the useful/correct.

Tags: Adobe Animate

Similar Questions

  • Windows live mail will not play a sound when new mail arrives

    Windows live mail will not play a sound when the mail comes and will not report in the task bar. I 'play a sound when niew messages come' checked in the options. What could be wrong?

    Hello

    The question you have posted is related to Windows Live mail and would be better suited to the Windows Live community. Please visit the link below to find a community that will support what ask you:

    http://www.windowslivehelp.com/product.aspx?ProductID=15

  • Laptop play outloud sounds when the headphones are connected.

    I have a laptop HP Pavillion with Windows 7 Home Premium, with a built-in microphone. I use my microphone on my computer to make Skype calls using the Skype program. I plug the headphones in my phone to hear what other people are saying in my Skype calls, however when I do this, other sounds coming from my computer are read aloud and do not get played in my helmet, so all those who are in the call to Skype with me can hear some sounds I play my computer.

    I would make sure all the sounds my laptop plays at all always go in the headphones and do not always play outloud as not to disturb the other memebrs in my Skype calls. Please help :( Is there a solution to this?

    Hi Swtgirl9314,

    Method 1:

    Step 1:

    In troubleshooting the problem, you can follow the steps below.
     
    a. Click Start, type Sound in the box to start the search.
    b. click sound in the results of search at the top of the start menu.
    c. click the reading notice the check mark next to the default device. For most users, the default device is pregnant, change of helmet. Make sure that the audio settings are configured as expected.

    Step 2:

    On the Read tab, select the playback device, click Properties, click the Advanced tab and make sure that the default Format is set to the value you expect. When you are finished, close this window to return to the previous window.

    Step 3:

    On the Read tab, select the playback device, click on configure and make sure that the configurations are set correctly.

    Method 2:

    If the problem persists then I suggest you to apply these below mentioned steps to cut all other sounds when windows detects a communication activity.

    a. Click Start, type Sound in the box to start the search.
    b. click sound in the results of search at the top of the start menu.
    c. click the Communications tab.
    d. click on the radio button according to your needs, under when Windows detects communications activity.

    After completing the steps above, you can check the issue.

    For troubleshooting you can visit this link below.

    Tips for solving common audio problems
    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-sound-problems

    Thank you, and in what concerns:
    I. Suuresh Kumar - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I make windows play a sound when you press the SHIFT key

    My keyboard doesn't have a light to indicate when it is capitalized. He used to play a sound, but it is more the fact after that I said not to do. However, when entering passwords that are case sensitive, it gives the wrong password. Can someone tell me how to re - turn on the sound.
    Its a Logitech MK320 wireless

    Look in Control Panel > accessibility, and then click "make the keyboard easier to use." Check the box "turn ToggleKeys. This will produce a note when you press the lock keys. Or just check the other box beneath it. In this way, you can turn the tone on or off without having to return to these settings.

    SC Tom

  • Why the Finder plays a sound when I move a file?

    I noticed that in versions of Mac OS X, from Lion (I have no experience with older versions) that Finder makes a sound when you move or duplicate a file. It is not located in /System/Library/Sounds or anywhere inside of the /System/Library/Components/CoreAudio.component . Does anyone know where is the audio file or how to disable (or possibly both)?

    System Preferences > Sound > sound effects:

    You can turn off the Alert sound, or uncheck: play the effects of its user interface.

  • My monitor plays a sound when I play what I hear is a low hum.

    my screen stays in analog permanently and sounds do not work, I went to digital it its worked but he spilled rite to analog sound has stopped working, I tried to search to find mistakes in my codecs and drivers nothing wrong and my volume is the highest, but still no sound

    Hi Powerpulse2,

    How did your audio cable from the monitor speaker connected to your sound card on pc? It is on the digital output? Try to connect to the normal speaker output.

    I hope this helps.

  • My Windows Media Player will play the video of an MPG file, but it will not play the sound. What is the cause?

    I do video editing.  I transferred my camera video file and Windows Media Player played the video and audio very well at the beginning.  I edited the file with editing software and exported the file again.  Now, the sound will not play using WMP but it will play if I use video editing software.

    As a result, I've uploaded new files from the camera and now WMP not give me sound on those either.  If something seems to be affected by my WMP.  Any help you can give would be much appreciated.

    Hi rgosmond,

    (a) don't you get any specific error message when you play the video?

    (b) what is the file format of the resulting video file after editing by using the video editing software?

    (c) you are able to play the files on the computer? You hear the sound?

    I suggest you try the following steps:

    O make sure that windows MediaPlayer is not muted, press F7 on the keyboard to turn the sound back on.

    Ø check if the volume is at a minimum in Media Player, press F9 on the keyboard to increase the volume.

    Verify that the default audio device is correctly set

    1. click on start, type Sound in the box to start the search.

    2. click on sound in the results of search at the top of the start menu.

    3. click on the tab reading notice the check mark next to the default device. For most users, the default device is speakers. Make sure that the audio settings are configured as expected. Follow these steps:

    4. on the playback tab, select the playback device, click Properties, click the Advanced tab and make sure that the default Format is set to the value you expect. When you are finished, close this window to return to the previous window.

    5. on the playback tab, select the playback device, click on configure and make sure that the configurations are set correctly.

    6. If the sound settings are well positioned, you are using speakers as the audio device and your speakers are already set as the default device, go to method 5 now.

    7. Select the audio device you want as the default audio device and then click on set as default.

    8. click OK to save your settings and close the sound dialog box.

    Now, check if the problem is resolved.

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Play a sound when a State transition

    Greetings,

    I want to associate a sound with a transition so that it is played during the duration of the transition.

    What is the best way to do that in flex Hero?

    Thank you.

    You can find the useful SoundEffect class, for example:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    title = "Sound Effect" >

    Alpha. State1 = "1" alpha.state2="0.5"/ > "

  • Is it possible to get Yahoo to play a sound when I receive email?

    I would like Yahoo to beep whenever I get the mail, I can not find a way to do it and don't even know if it's possible. Any help would be great. BTW, Youtube, media player and all other sounds just right.
    Thank you

    Hi, you could try the add-on X-notify.

    Hope that helps.

  • BlackBerry BOLD 9700 smartphones - Messenger of BB will not play sound when on the home screen

    Bold 9700

    I have problems with my BB Messenger doesn't play does not sound, but always vibrant, when on the home screen.

    It will play the sound when in other applications, but not the home screen.

    I have the sound to play "always."

    Any help would be greatly appreciated

    Open 'Profiles' then open 'Edit profile' and then select the profile that you are currently using.

    Here to expand 'Instant Messages' and go to "BlackBerry Messenger Alert", make sure that you have a selected ringtone, and that the volume is not set to silent.

    I hope this helps.

  • No sound when I work after effect

    Hi all

    Whenever I work in after effect cs3. I get no sound when working in after effect. I want to play my movie after the effect with sound, so I can put some good sounds in my film, but I don't see that the film plays without sound. What do I do, can someone help me?

    I don't know if I understand you. If it comes from a camera that uses DVD-R, it's very probably AVCHD or MPEG-2 and since apaprently form, it penetrates into the first, why not simply export a WAV file from there? There is no requirement for her to appear in a movie file, you can also top with brand new in AE...

    Mylenium

  • could we have a * filter * option to play a sound?

    I'm bored of Eudora. I had a sound for each of my clients, so I knew that to get up and come to answer them. I know that we have a framework to play a sound when * any * message arrives, and I have this job very well.
    But if I had a filter option, as I had in eudora, then, as I say, I could play different sounds for the email addresses that come in. It allows me to be better serving the customer to my clients, because I hear and come to the computer to take care of them.

    ToneQuilla

  • Play a sound

    Anyone has an idea on how to play a sound when a timer is completed in AS3?

    im making a timer and once the Timer ends, I want to have it play a sound.

    any help?

    Have you looked in the Sound class? The SoundChannel class can also be used to find out when the sound has finished playing (and other features).

  • Play a sound mousing in a canvas html in Flash CC document

    Hello

    I looked for a while to do something that I'm sure is simple, but I can't find the answer. I'm sorry if I missed it, but I appreciate any help anyone can provide.

    I have a simple button in flash that I am converting a document to html canvas so I can put like html in my Web site, with animation and its passage of the mouse. I had the animation works as I want, when I publish to HTML, but using Actionscript 3, I got a noise that played when the user said above the button. I want it continue to play a sound when the mouse user in my HTML file also, canvas top but I did not have success with the conversion of my Actionscript to Javascript and am not an expert by any means of javascript. I also have several formats of audio file linked in the code for all browsers that do not work with mp3 files. I can convert the audio file without problem but do not know how this code... I found some general tutorials on this, but have not been able to get it to work with anything I've tried so far.

    Here is the Actionscript code I had which works very well in my original document when I export a .swf file.

    Stop();

    import flash.media.Sound;

    import flash.net.URLRequest;

    import flash.events.Event;

    sprayGunbtn.addEventListener (MouseEvent.MOUSE_OVER, playSound);

    var myExternalSound:Sound = new Sound();

    var req:URLRequest = new URLRequest ("ShortSpray.mp3");

    myExternalSound.load (req);

    function playSound(event:Event) {}

    myExternalSound.play ();

    }

    If someone could help me to convert it into Javascript so that it does not work when I publish my .fla to HTML file, I would be very happy. Thank you very much in advance for your time...

    You can follow the steps below to easily play a sound when running - as on mouseover.

    1 make sure that your audio is imported into the library and has a specified binding name.

    2. open the Windows Menu-> Panel Code fragments, code and develop HTML5 Canvas-> managers section of events.

    3. Select your button on stage and apply the Code snippets MouseOver event.

    4. in the function MouseOverHandler add the line below and the test film:

    playSound ('audio_linkage_name');

    If you are still having problems let me know.

    In addition, you can go through the documentation for SoundJS for control with HTML5 Audio.

  • Play/stop sound on a single button (AS3)

    Hello

    When you click the first button, it should start the song, when you click a second time on the sidelines, it should stop the song. How can I do that with actionscript 3?

    concerning

    Simon

    A very basic example:

    You would need 3 var:

    private var _sound:Sound;
    private var _soundChannel:SoundChannel;
    private var _soundChannelPosition:Number = 0;
    

    Then, create a sound:

    _sound = new Sound(new URLRequest("some.mp3"));
    

    Stop/play the sound when you click on:

            private function click(e:MouseEvent):void {
                if(_soundChannel == null){
                    _soundChannel = _sound.play(_soundChannelPosition);
                } else {
                    _soundChannelPosition = _soundChannel.position;
                    _soundChannel.stop();
                    _soundChannel = null;
                }
            }
    

Maybe you are looking for

  • HP all-in-one 21-2024: HP all-in-one 21-2024 upgrade processors

    I have a HP all in one 21-2024 with a dual core AMD E1 - 6010 APU and upgrade to a Quad core.  Can someone please lead me in the right direction as to what CPU they would recommend.  It all just SLOW... I installed 16 GB of Ram...

  • 15 - ay041wm: System off

    BIOS has admin password cannot go beyondCode 58762912

  • Satellite 1800-314-replacement of the CD-ROM disc

    We have an old Toshiba Satellite 1800-314 the CD-ROM drive appears to be failing - it often will not recognize a CD, or run the applications of one. First of all, the CD-ROM drive is not removable, so the laptop must be open. I'm familiar enough with

  • Scaling of voltage of the thermocouple before voltage to temperature conversion

    Hello I have a module of data USB-6211 acquisition entry with Labview 8.6, and I will measure temperatures using a type R thermocouple.  Because this thermocouple voltages are very small (about 0-20 mV), I'll use an external amplifier (50 x gain) to

  • Clear data

    Hi guys, I have an Acer V5 - 122P I need to erase all the data so that I can sell it. It has been upgraded to windows 10.Thanks.