A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: sounds playing too early

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Posts
    19

    sounds playing too early

    I've encountered this problem many a time before and I want to get to the bottom of it.

    I've cobbled together a small animation using 1 sound which comes up twice in the timeline in order to illustrate my problem.

    Here is the timeline and stuff:

    http://www.leo-stuff.com/timeline1.JPG


    The problem is when i come to exporting the flash movie, the second sound comes in way too early as you can see in this swf:

    http://www.leo-stuff.com/ep.swf

    In fact, in order to get the sound to come in at the right time, I have to move it along in the timeline way after the animation it is supposed to be corresponding to has happened like this:

    http://www.leo-stuff.com/timeline2.JPG

    which is rediculous i'm sure you'll agree.

    could someone tell me where I've been going wrong all this time? Thanks.
    meh.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    The best is to manipulate the sound by actionscript using attachSound.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    you're going to have to explain that, animation is my trade not as :/
    meh.

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    In the library click on your sound and give it linkage id. Give it a unique name. Then on the timeline when you want to play the sound you add a script like this:

    var my_sound:Sound = new Sound();
    my_sound.attachSound("soundid");
    my_sound.start(0, 1);
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    would i be able to hear it in the timeline for lip syncing? I'm guessing I wouldn't... but i'll try that out later, thanks.
    meh.

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    I appreciate your help but is there any way to solve this problem without using action script and downloading programs and things? I am (laughingly) an animator and I can't be doing with this faffing about.

    I'm going to try adjusting the sound properties see if that does anything. I've managed to solve this problem in the past just by fiddling about...
    meh.

  8. #8
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Do you have your sounds set to "Stream"? Click on the sound and look in the Properties Panel. If it's set to "Event", try setting it to "Stream".

  9. #9
    Junior Member
    Join Date
    Jan 2005
    Posts
    19
    it's stream.

    i just set them to event and now they're playing at the right time, which is not ideal for lip syncing but at least it works.
    Last edited by leoZ; 07-25-2006 at 03:57 AM.
    meh.

  10. #10
    Junior Member
    Join Date
    Jul 2006
    Posts
    14
    Quote Originally Posted by cancerinform
    In the library click on your sound and give it linkage id. Give it a unique name. Then on the timeline when you want to play the sound you add a script like this:

    var my_sound:Sound = new Sound();
    my_sound.attachSound("soundid");
    my_sound.start(0, 1);

    halo, i'm flash newbie...

    wanna find out... the above sound id is it the name of the sound file that i imported to the library? so it will look like below rite?

    my_sound.attachSound("effect.mp3");

    *****************************************
    p/s: I know what's the id already...

    =)
    Last edited by liyen; 07-25-2006 at 04:56 AM.

  11. #11
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    if effect.mp3 is the sound id, right. However, I usually give a different id from the file name, for example effect in this case.
    - The right of the People to create Flash movies shall not be infringed. -

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