Sound class pause

Hi i have a flash presentation, which has a pause and play
button.
the pause button pauses my movie fine, except i have voice
sound as a sound class, the sound starts to play, but i can not get
it to pause or stop
any ideas what i need to do?
i have the following code

no, your code above is not correct: your onRelease functions
are written as such to be placed directly on your button objects
and not on the root time line; additionally, the function
volAdjust(), which is the function responsible for controlling your
sound, is not present in your code at all.
to fully understand what is going on, take five minutes to do
this:
1.) open a brand new flash document.
2.) import a sound to your library ( file > import >
import to library ), open your
library ( f11), right-click on the sound inside your library
and select linkage,
check export for actionscript, make sure export in first
frame is checked, and
then enter, newWelcome , into the identifier text field.
3.) draw a rectangle on stage and convert it to a movieclip
(f8) - name it whatever you wish.
4.) with the newly created movieclip selected, go to your
properties inspector
and enter the string, btnPlay , into the instance name text
field.
5.) open your library ( f11) and drag another instance of the
movieclip you just
created onto the stage.
6.) with the newly dragged out instance of your movieclip
selected, go to your
properties inspector and enter the string, btnPause , into
the instance name text field.
7.) make a new layer above the one you have working in and
name it actions.
8.) lastly ,copy and paste the code i sent you into the first
frame of the layer
actions. (note: your movieclips, btnPlay and btnPause,
should be on the first
frame of your second layer ( the layer beneath your layer
labeled actions ).

Similar Messages

  • Looking for information about AS3 sound classes in "audio" wrong places?

    I'm looking for in depth information about ActionScript 3.0 sound classes. No matter where I search I continually encounter the same sort of kindergarten level descriptions, which never teach more than what we can readily glean from Adobe's documentation. Someone must know where there a discussion that really gets to the heart of the matter.
    I've read Adobe's LiveDocs on the Sound, SoundChannel, SoundMixer, SoundTransform classes. Indeed, they provided me enough guidance to create my own streaming MP3 player, with volume, pan, my own custom mono mix, http request, a preloading animation, and peak meters ...
    Here's an example (in the last statement of the following code) where I understand the end effect, but I fail to comprehend what happens at the compiler level:
    var currentSoundSource:Sound = new Sound();
    currentSoundSource.load(new URLRequest("http://www.mySite.com/myRecording.mp3"));
    var audioChannel_01:SoundChannel = new SoundChannel();
    audioChannel_01 = currentSoundSource.play();
    Unfortunately the class definitions in LiveDocs are quite terse, and they're seemingly incomplete with respect to:
         •     advice on best practices
         •     a thorough coverage of class to class interactivity
         •     a description of exactly how audio streams/plays into channels
    ... and in certain cases it appears that Adobe's descriptions are not fully accurate.*
    Regarding best practices, at first blush I'm sure everyone ponders over the fact that SoundChannel and SoundMixer have a stop method while the Sound class does not.
    One assumes that this surprising design must bear some advantages. If so,  what are they? Where are the analog sound mixer analogies? What would be the disadvantage of a sound class with a stop method ...  particularly when they have their own play method?
    Where are the discussion of these concepts? (Even if Adobe hired the wrong guy to write its sound classes, there should be some follow through that thoroughly explains the existing situation.)
    Phrankie
    * Here's an instance where the docs appear to be partially in error. (Is "and play" mistakenly included in the following?)
    "The Sound class lets you lets you create a new Sound object [and] load and play an external MP3 file into that object."
    ... uh, mmmmmm ... we play an MP3 into a sound class object?
    Wouldn't it be more accurate to say the following:
    A soundChannel can receive the audio data from a sound class object. We can play a sound object into an SoundChannel and manipulate it by altering the SoundChannel's soundTransform property, and we can stop it with the SoundChannel's stop method. 

    check everything you can find written by tinic uro.  this will get you started:  http://www.kaourantin.net/

  • About playing dynamic generated sound using Sound class

    Dear sir:
    The live doc of Flex 4 says:
    In Flash Player 10 and later and AIR 1.5 and later, you can also use this    class to work with sound that is generated dynamically.    In this case, the Sound object uses the function you assign to a sampleData event handler to   poll for sound data. The sound is played as it is retrieved from a ByteArray object that   you populate with sound data.
    and i read one article(the following link)
    http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html
    it said: The Sound class only support 44100 sample rate,32 bit,2 channel sound data, is that true?
    Then if i get one ByteArray( 8000 sample rate,16bit,1 channel), how can i modify it to let the Sound class play it?
    thanks..

    Worked perfectly.  Thank you thank you!
    Jen

  • Sound class

    Hi everyone. I'm creating an audio player which will receive
    xml information from a server and play the requested sone. I have
    all that set up. The only problem I'm having with is creating the
    progress bar while the sound is streaming. What happens is when the
    audio player is opened, the song starts playing because of the
    streaming property that I set in the actionscript, but the progress
    bar doesn't show up until the song is fully cached on the user's
    machine. So the effect is you don't see the progress bar when the
    audio player opens and the song plays. Instead the progress bar
    will appear a couple of seconds after the audio player starts
    playing. I've put the project up on my site, so you can take a look
    at it and see what I'm talking about,
    www.mark-yieh.com/airspun/newaudioplayer.html. If you know how to
    fix it please let me know. It will really be appreciated. Thanks.
    I've looked at all the event handlers in the sound class, but none
    of them let's me gather information from the sound file until it's
    fully loaded. For example, with the MovieClipLoader class, there's
    an onLoadInit handler and an onLoadStart handler and an
    onLoadProgress handler, but there's none for the sound class. Is
    there another solution?

    if you're attempting to get the sound.duration before it has
    loaded, then you'll find that this will only return the number of
    seconds downloaded so far. sound.position should work okay though.
    check out the comments in
    livedocs
    for sound duration for some handy ways to approximate this
    property during streaming.

  • When songs are playing in itunes the sound keeps pausing and making little clicking noises. Any ideas?

    When songs are playing in itunes the sound keeps pausing for brief moments and making little clicking noises. Any ideas how to fix this?

    Error -36 is an I/O error, which could indicate a damaged Catalog file, corrupted bitmap or (even worse) a dying HD.
    I would recommend to run Disk Utility and perform a 'Verify disk'.
    If lots of errors are found, try to save as much files as possible to another disk.
    Then perform a 'Repair disk'. Repairing a catalog file or bitmap might cause loss of files, that's why I recommend to verify first and save the files, before repairing.
    M

  • Sound Play/Pause

    Hi all,
    I'm sure this is very simple to do but I am new to Director.
    I'm using Director MX2004 and I am trying to create a multistate
    button that pauses Channel 1 when pressed, then continues when
    pressed again. I know I can use the following lingo to pause the
    sound Channel but I don't what to do to continue.
    on mouseUp me
    sound(1).pause()
    end
    Can anyone help me out with what I need to add to be able to
    resume playback? I can't use soundEnabled or even stop since this
    project relies on the sound for navigation purposes. I just need to
    pause and then play sound channel 1 from one button.
    Thanks for the help!
    Chris

    Found this by tcoursey on mediamacros (www.mediamacros.com):
    global tm
    global paused
    global soundfile
    on beginsprite
    paused = 0
    end
    on togglesound
    soundfile = sound(1).member
    if paused = 0 then
    tm = sound(1).currenttime
    sound(1).pause()
    paused = not (paused)
    else if paused = 1 then
    sound(1).play([#member: member(soundfile), #startTime: tm])
    paused = not (paused)
    end if
    end
    on mouseup
    togglesound
    end

  • Why Sound Class is greyed out?

    Hi, there
    I am trying to assign a sound class, but found it was greyed out. I'd appreciate if someone could help me to find a way...Thanks!

    I think you're right. The file I was working on was originally in AS2...Thanks a lot!

  • Sound class help?(oop)

    hey,
    i have got all my public vars for sound class but im having trouble on how i would execute them because i normal would use event listener but its OOP lol so how do you get that functionality :/
    ---code in star.as file:
    package
        import flash.display.MovieClip;
        public class star extends MovieClip
            public var my_sound:MySong = new MySong();
            public var my_channel:SoundChannel = new SoundChannel();
            public function star()
    thanks everyone

    dont worry i learnt oop and made my own class here it is if anyone has the same problem!
    Code:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.media.Sound;
        public class SoundClass extends MovieClip
            var sound = new Sound  ;
            var mySound:MySong = new MySong  ;
            public function SoundClass()
                mySound.play();
    Hope this helped somebody else

  • Performance problems with external sounds and Sound class

    I'm using Sound & SoundChannel classes to load and play external MP3s and I'm seeing terrible playback performance on my 3G phone. Audio starts out ok, but will gradually get more and more choppy and eventually crashes the app. The MP3s themselves are typical sizes, 2 - 6 MB and of various types (VBR, CBR).
    On top of that, when the phone gets locked (with the app still running), the audio sputters and stops completely. When I unlock, it begins where it left off. Anyone else seeing this?
    My code is pretty standard:
    private var soundPlayer:Sound;
    private var soundChannel:SoundChannel;
    public function load(url:String, playNow:Boolean = true):void {
      if (soundChannel) {
        soundChannel.stop();
      soundPlayer = new Sound();
      soundPlayer.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
      soundPlayer.addEventListener(ProgressEvent.PROGRESS, onProgress);
      soundPlayer.addEventListener(Event.ID3, onID3);
      trace('Loading new stream: '+url);
      var request:URLRequest = new URLRequest(url);
      soundPlayer.load(request);
      if (playNow) {
        this.isPlaying = true;
        soundChannel = soundPlayer.play();
        soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);

    this is from another forum (http://discussions.info.apple.com/thread.jspa?threadID=2542931&tstart=0&messageID=12106188 ):
    "I've spoken to the developers of of couple of these apps, and they've all said it's a memory fragmentation/low memory condition.
    Restart the phone. Don't just turn it off and on, but restart it.
    Hold the on/off button and the home button down like you were going to turn it off. When you see the swipe to turn off message, keep holding the buttons down.
    In a few seconds the screen will flash, and then go dark.
    Now it's really off.
    Turn it back on (restarting it). All should be well.
    The iPhone is really a computer. Performing a restart like this every  once in a while (weekly, bi-weekly) is a good idea, esp if you use  memory intensive apps."
    coop

  • Video loses sound then pauses

    Hello everyone! I've recently encountered a problem in watching videos online. The video works well at first then after a couple of minutes it suddenly loses sound and then it pauses, this occurs randomly until the video is done. no matter which site I go this always happen. If anybody can help me I would really appreciate it. Thank you.

    Can you try if this still happens with the latest Flash Player beta: http://labs.adobe.com/downloads/flashplayer.html

  • Audigy NX 2 sound issue (paus

    I have recently purchased an Audigy NX 2 to connect with my Yamaha home cinema amp, I have it set to pass everything through the optical SPDIF for processing by my Yamaha.
    The issue I have is that with the SPDIF output sampling rate at 48kHz there are frequent pauses in sound, if I change the output sampling rate to 44.kHz these pauses lessen but are still there.
    Has anyone else experience issues like this? I have installed the latest drivers but with no difference. Is it an issue with me not using a USB2 connection and there is simply not the bandwidth to pass the signal along?
    Any help appreciated.

    Yunior,
    I think that you are saying that sound is speeded up when you watch movies. If that is so, is there a time scaling option (such as in EAX Console or MediaSource organizer) in the software you use for this? And what software are you using for watching movies? Also, if you have not already, try disabling your onboard soundcard in BIOS.
    Zmartwiony je?li JA jestem przest?pstwo , opr?cz czy m?wisz po Polski?JA jestem inaczej bieg?y w czym? ono, opr?cz JA wola pr?bowa?. Oko?o tw?j Rewizja NX, Zdaje mi sie jeste? powiedzenie ?w zdrowy jest regulowa? szybko? w g?rze podczas ty pilnowa? kino. Je?li czyli prawdziwy , czy jest czas skalowanie wyb?r (taki jak tu jest w ten EAX Konsole albo MediaSource Organizator) w ten oprogramowanie ?w jeste? przy pomocy pod k?tem ten? Ono mog? tak?e wsp?pracownik je?li ty uto?sami? co oprogramowanie jeste? przy pomocy pod k?tem str?owa? kino. Je?li masz nie ju?, pr?bowa? czyni?cy niezdolnym tw?j na pok?adzie soundcard w BIOS.Message Edited by Katman on 08-04-200709:09 PM

  • Automatically generated (Sound) classes

    Hi all,
    Quick summary:
    I'm trying to compile a SWC file with a lot of assets in it in an as easy possible way. "Easy" for a not so technical end user, not perse the way to acchieve that goal. Goal is to streamline a process to generate SWC files with as little possible tech for the person doing it.
    So, sort of like  manually doing:
    * Import files into Flash
    * For each library item select "Export for actionscript" and have Flash generate the basic class.
    * Publish as SWC
    but without the Flash IDE and the possibly labourous process.
    Right now I'm trying to put an AIR project together that generates classes based on a file list. The classes can than be added to a Flash Builder library project to generate a SWC file from it (copy in finder, check classes in Project properties, done)
    I can generate the classes for graphics like below. Such a class can then be instantiated from within the host application.
    package
              import flash.display.Bitmap;
              import flash.display.MovieClip;
              public class __0038_asset extends MovieClip
                        [Embed(source="assets/__0038_asset.png")]
                            private static const gfx:Class;
                        public function __0038_asset()
                                  super();
                                  addChild( new gfx() as Bitmap );
    Allthough this adds another level to the display list (which looks kinda sloppy to me), it works.
    However, for this to work for sound files I need to create a class implementing all possible methods and properties of the soundclass and handle the events and such. There is no way to extend Sound and then do something like you would/can with graphics.
    This is what I got:
    package
              import flash.media.Sound;
              import flash.media.SoundLoaderContext;
              import flash.net.URLRequest;
              public class _000_cover_hotsp_authormp3 extends Sound
                        [Embed(source="assets/000_cover_hotsp_author.mp3")]
                        private var snd:Class;
                        public function _000_cover_hotsp_authormp3(stream:URLRequest=null, context:SoundLoaderContext=null)
                                  super(stream, context);
                                  var mySound:Sound = new snd() as Sound;
    But that aint gonna work ofcourse.
    Does anyone know if there is a way to get to the format the Flash IDE generates the classes with?
    Thanks in advance.
    Manno

    Wel, here's the answer. Must have read it once since it is in the moock book, but stubled across it on the interwebs at: http://blog.nightspade.com/2010/02/01/embedding-asset-at-compile-time-in-pure-as3-project/
    For images use:
            [Embed(source="assets/Frog&Stranger02_03-titelblad_height_1024px 2.jpg")]
              public class a_A2BA79B5_CE46_F942_1AB2_CC26D8F7FCC8 extends Bitmap
                        public function a_A2BA79B5_CE46_F942_1AB2_CC26D8F7FCC8()
                                  super();
    and for sounds:
              [Embed(source="assets/000_cover_hotsp_author.mp3")]
              public class _000_cover_hotsp_authormp3 extends Sound
                        public function _000_cover_hotsp_authormp3()
    Now, lets review some code to see if I can apply this elsewhere too

  • Awful sound when pausing

    Whenever i pause something that is playing in quicktime, either online streaming or off of my hard drive, quicktime plays this awful sound. the video stops, but i get a non stop sound similar to when a game freezes, or a segment of sound is playing over and over very fast, not sure how to describe it. It mostly happens on the pc, but i just recently purchased a MacBook Pro, and it also does it on that. Any reason for this becasue i would like to pasue movies without turning the audio off.
    Thanks

    This was not solved

  • Terrible sound when pausing video

    Whenever i pause a video, spacebar or button, the audio, if any is playing, will not stop, but will repeat very quickly like when a video game locks up. Any one know about this???
    Thanks

    I was not getting any sound at all. I just recorded video on my friends iphone and I could totally hear the audio. I did a full restore back to factory settings and it is working now. I'll have to see how it goes.

  • 8Gb - No sound after pausing audiobook

    My 8Gb nano has a strange problem. When listening to an audiobook (from Audible.com), if I pause the player, then let it sit long enough to go to sleep (about an hour), when I try to resume playing there's no longer any sound. It looks like it's playing (play icon, time starts counting), but it's totally silent. I have to go back, select a song (which will play fine), then go back and select the audiobook again. The audiobook will then play fine, but it's a real hassle to do this every time I use the player.
    If I pause the player and let it go to sleep during a song or podcast, it's fine - this issue doesn't happen.
    If I don't wait long enough for the unit to go to sleep (i.e., the screen comes on when I plug the headphones back in), then it's fine - this issue doesn't happen.
    My 2Gb first generation nano never did this on any audiobook. I've tried several of the same audiobooks on both - every one works on the 2Gb, but not one works properly on the new 8Gb.
    Anyone else seeing this? I'm not sure if it's a bug or if I have a defective unit.

    I don't believe there is any way to revert back to the original 1.0 - I tried to restore mine, but it just put 1.01 back on there and didn't give me an option. The Apple rep I spoke with didn't believe there was a way to go back to 1.0. He said they didn't have any record of this being an issue, though given that it's only been out a week it's still early. He suspected it's a bug instead of a hardware issue, which makes sense to me. However, I'm a little nervous waiting too long for it to be fixed, because if it is hardware I don't want to go past the point which I can exchange it at the store I bought it from.
    I agree, it's extremely annoying. I use it mostly for audiobooks, so I can't wait for a fix. Good to know there's at least one other person out there who's duplicated this.

Maybe you are looking for

  • How to start a AT PSU whitut mobo

    How do i start a AT PSU by not using a mobo? I know how do to it with a ATX, buy i dont got any free ATX for my project... It is by using a wire and the 20 pin, right?

  • Add element to array of cluster

    I have an array of cluster. Cluster contains two elements. How to add an element in cluster at run time on the second position efficiently? In other words dont want another copy of cluster which contains three elements and copy the original two eleme

  • GL account marked for deletion

    Hi , I am trying to do MIGO and I am getting this error "G/L account marked for deletion" . Pls help to reolve .

  • Exporting Animated Slides for widescreen - Best format for export?

    I need to build a looping video to be played on a bunch of flat-screen TV's mounted to a trade-show booth. I'm guessing I need to build it for wide-screen - 16.9 ratio? I used iMovie to build a simple video of images panning in and out. When I go to

  • Lost Admin userid and password - iOmega EZ Media & Backup Server

    Bonjour, How I can reset the admin user password and ID ?   I have trusted my browser to store this information, but seems to be lost.  I have tried to get to the admin panel to upgrade to the latest firmware... Any options without erasing the conten