A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] variable sound speed

  1. #1
    binaryhit
    Guest

    resolved [RESOLVED] variable sound speed

    Is there any way to gradually increase the speed of a sound effect by using a variable?

    Also is there a way to gradually increase the volume of a sound effect by using a variable < I'm pretty sure this one is possible but i'm more concerned with the top question.

    This would be cool!

  2. #2
    binaryhit
    Guest

    Plz Plz Plz

    Please could someone help me with this cos it's pretty urgent???

  3. #3
    binaryhit
    Guest

    haha

    I take it this one is pretty hard huh, I have been trying myself unsuccesfully to write a script but realy do need help, PLEEEEAAAASSSEEE lol

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    139

    Re: haha

    1) You can't change the speed of a sound (or the speed of sound, for that matter).

    2) You can change the volume of a sound. Your sound needs to be a variable, which basically means you need to have used attachSound to import it (which might lead to preloader problems, if you are using one - look on http://www.flashguru.co.uk for the information and workaround if necessary). Anyway, the basic method is like this.

    1) in your library, right click (or Mac: ctrl-click) on the sound you need to deal with. choose "Symbol Linkage Properties", choose the "Export" option and put a name for the sound eg. "thesound"

    2) At the place in the movie that you want to play the sound, do this:

    s = new Sound();
    s.attachSound ("thesound");
    s.play(0, 1000000);

    the 1000000 essentially means: play ad infinitum.

    then you can set the volume by doing

    s.setVolume (PERCENTAGE);

    you can also do:

    s.setPan to set the balance of the sound.

    Does this help?

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