A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: play and pause audio

  1. #1
    eLearning Dev Monkey
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    28

    play and pause audio

    hey

    i've got some audio of some narration for a prject, and need to be able to allow the user to pause and resume as they need. any tips? i've seen a few examples but need them explaining to me

    keep it frosty

    vince
    www.MultimediaMarketing.Com
    Global Learning - Better Marketing

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Posts
    10
    I'm kinda guessing but i think you could just put the sound into a movie clip of it's own- make sure the sound is set to stream. Then create two buttons that control this MC independent of the main timeline. If that's not clear then there are loads of tutorials on this site dedicated to sound.

  3. #3
    immoralator
    Join Date
    Dec 2001
    Location
    UK
    Posts
    270
    Code:
    //define sound object
    tune = new Sound();
    tune.attachSound("music");
    tune.start();
    //create pause function (convert position into seconds)
    function pause() {
    	pausePoint = tune.position/1000;
    	trace(pausePoint);
    	tune.stop();
    }
    //restart track and skip to point where we paused it
    function resume() {
    	tune.start(pausePoint);
    }
    //controls
    pause_btn.onRelease = function() {
    	pause();
    };
    //
    resume_btn.onRelease = function() {
    	resume();
    };

  4. #4
    eLearning Dev Monkey
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    28
    cheers!
    www.MultimediaMarketing.Com
    Global Learning - Better Marketing

  5. #5
    eLearning Dev Monkey
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    28
    sorry, where's the option to set the audio to streaming?
    www.MultimediaMarketing.Com
    Global Learning - Better Marketing

  6. #6
    Junior Member
    Join Date
    Oct 2002
    Posts
    10
    change the "sync" to streaming on the sound panel
    Attached Images Attached Images

  7. #7
    eLearning Dev Monkey
    Join Date
    Oct 2002
    Location
    Manchester, UK
    Posts
    28
    i found it; its in the properties window.

    cheers again!
    www.MultimediaMarketing.Com
    Global Learning - Better Marketing

  8. #8
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228
    Just found this tutorial on Flashkit.com. This should explain all there is about the sound object!

    Check out the tut
    Be aware of, that this is a FlashMX tutotial!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center