Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder bigtiger's Avatar
    Join Date
    Oct 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Stop a streaming sound

    Currently, I used the sound object to build a simple MP3 Player.
    It worked without any issues that it could play, advance, etc.

    When the stop button was pressed. The downloading of MP3 was still continue.

    These are the commands that I have used to stop downloading and playing sound files, Sound.stop and stopAllSounds.
    But, it seems that these commands could not stop downloading of sound files.


    Any help are appreciate.

    Eric,

    Attachment:
    Stop a streaming sound-streaming_sound.jpg
    Last edited by bigtiger; 05-10-2009 at 02:51 PM.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    The sound object only controls the playing, not the loading. To stop it loading will also remove it from Flash, I believe. I can't be 100%, but you would just need to clear the loading process.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    New Coder bigtiger's Avatar
    Join Date
    Oct 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I apologize that I have not specify it correctly for my flash version used, it is flash 8.0.

    I have used some styles like these,

    Code:
    var song:Sound = new Sound(this);
    
    ...
    
    song = null;
    song = undefined;
    delete song;
    but none of them would work .

    I also found that Flash CS3 or later had a method called close() on Sound Object from ActionScript 3.0 reference that could close the stream.
    (I found that by google and I'am just lucky )

    Am I right that it seems that there are not possible to do that with flash 8.0.
    Because it will be waste network bandwidth when someone change the song list as mulitiple songs are downloaded simultaneously.


    Eric,

    Thanks,

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    If you reuse the stream (song in your case) then it should replace with the new stream and stop loading the old. Check the function list for sounds in actionscript (I would but its not loading right now) and look at whats there.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    New Coder bigtiger's Avatar
    Join Date
    Oct 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That seems did't work also.

    I was used these simple statements,

    Code:
    // frame1
    var index:Number = 0;
    var player:Sound = new Sound(this);
    var songlist:Array = ['song1.mp3', 'song2.mp3', 'song3.mp3'];
    
    // button1
    on(release)
    {
        _parent.player.loadSound(songlist[++index], true);
    }
    Thanks,

    Eric,


  •  

    Tags for this Thread

    Posting Permissions

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