A Flash Developer Resource Site

Results 1 to 20 of 36

Thread: onSoundComplete, attach and play next sound DELAY

Threaded View

  1. #1
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,650

    onSoundComplete, attach and play next sound DELAY

    It's like this. I have splitted a 1 min song into 8 parts. I attach part 1 by using this code:

    code:
    			s = new Sound();
    s.attachSound("1");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    gotoAndStop(2)



    When that part is done playing, it goes to frame 2 where the next part is played:

    code:
    			s = new Sound();
    s.attachSound("2");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    gotoAndStop(3)



    And then goes to frame 3 to play the next part etc...

    The problem is that there is a split second delay between each sound, so it doesnt sound right. Is there a way to fix this?. I thought that the delay is maybe caused cuz it has to stop the sound, goto the next frame and play the next part. So I tried this instead by thinking maybe it's faster:

    code:
    onClipEvent (enterFrame) {
    if (_root.play == "yes") {
    _root.play = "no";
    s = new Sound();
    s.attachSound("0");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("1");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("2");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("3");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("4");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("4");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("5");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("6");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("7");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    s = new Sound();
    s.attachSound("8");
    s.start(0.0, 0);
    s.onSoundComplete = function() {
    };
    };
    };
    };
    };
    };
    };
    };
    };
    };
    }
    }



    But this method had the same delay. Maybe it's possible somehow to start the next part 0.5 secs before the previous part has finished playing?... donno how, maybe you guys do?


    Thanks for any help.


    Edit:

    I searched for help again and found this:

    code:
    // create sound object for first loop
    myLoop = new Sound(target to mc);
    myLoop.attachSound("linkage id");

    // create sound object for 2nd loop
    myLoop2 = new Sound(target to another mc);
    myLoop2.attachSound("another linkage id");

    // start first loop
    myLoop.start(0,10);

    // start 2nd loop after first complete
    myLoop.onSoundComplete = function(){ myLoop2.start(0,10)}



    It gives the same delay... and there is nothing wrong with my sound files cuz they are perfect, and if I import them into an audio program and put each part after each other, it plays perfectly.

    edit2:

    Seems like more people has the same problem, and in case you ask, here is some info:

    Each sound loops perfectly using "start(0,99)"
    I am using Windows XP Pro and have tested it inside Flash and with the flash player. Also tried in IE 6.02.
    The Flashplayer is the latest 7.0 and I'm using Flash MX.
    Last edited by Ironclaw; 11-03-2004 at 07:35 AM.

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