PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Flash5 pause/resume sound while it's streaming in AS2?
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: pause/resume sound while it's streaming in AS2?

  1. #1
    Registered User
    Join Date
    Jun 2010

    Unhappy pause/resume sound while it's streaming in AS2?

    Is there a way to resume a streaming sound once it's been paused and whilst it's being preloaded in AS2?

    The issue being that start() won't work till the song is fully downloaded, loadSound() is only called initially and attachSound() can't stream.

    So first the sound is initiated with loadSound(), then I make it "pause" with stop() and what do I use for resuming? loadSound() with re-initiate it and start() won't work till the sound is fully preloaded, what the hell??

    Is there any other way of streaming external MP3s in AS2? Will simply switching to AS3 solve this? Thanks

  2. #2
    Join Date
    Sep 2009
    Well first of all, are you streaming from an XML of are you using the attach sound script. If you are streaming from an XML, I have used a script like shown below to toggle pause or play on the current song that is being streamed.

    Actionscript Code:
    //This is the toggle play function
               //create a new sound variable
        sound = new Sound();
        //load the music
        sound.loadSound(songs[musicnum].attributes.src, true);
        //set volume
               //change play/pause icons
        playing = true;
         //now here is the toggle pause function
               //change play/pause icons
        playing = false;

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