A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Controlling timeline sound volume

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    28

    Controlling timeline sound volume

    I have made a flash clip that is set to music located in a layer of the movie. How allow the viewer to control the volume of the sound? I have found plenty of tutorials showing how to start and stop sound. But I want the sound to play atomically and the user just to be able to control the volume.

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    i see this code my help:
    allSound=new Sound();
    allSound.setVolume(0);

    but where does it go?

  3. #3
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    it is best to put the music in its own movieclip. Put the following code In the first frame of the movie clip.

    soundclip = new Sound(this); // this connects the sound object to this timeline
    soundclip.setVolume(0);

  4. #4
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    Thank you,
    But how do they control the sound once i do that?
    I am very new and would love any and all help.

  5. #5
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    I am not sure what you are asking. Perhaps you want to make a slider to control volume?

  6. #6
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    Quote Originally Posted by hp3
    I am not sure what you are asking. Perhaps you want to make a slider to control volume?

    I have made a volume slider but I’m not sure how to get it to effect the sound in the timeline. I have the sound in the main timeline because my movie is synced to it.

  7. #7
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    can you post the fla? i'll do it for you and explain how it was done.
    If you don't think you're going to like the answer, then don't ask the question.

  8. #8
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    Quote Originally Posted by EQFlash
    can you post the fla? i'll do it for you and explain how it was done.
    WoW! That would rock! I am brand new to this community, how do I post the FLA. I have server space. Please let me know how/where to post the FLA. I will be so grateful for this help. /drool

  9. #9
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    just click on post reply under your name. type something the box, and click on the button "manage attachments". a window will popup, click on browse, select your fla, click upload and it will show you whether it uploaded or it was too big. if it uploaded close the popup and click submit. to post your fla
    If you don't think you're going to like the answer, then don't ask the question.

  10. #10
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    After striping everything out but the volume slider and replacing the MP3 with a small 9 second sample my FLA is still 15,895KB although my SWF is 18KB. Any thoughts on how to get it down?

  11. #11
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    To meet the file requirements I stripped out everything and changed the mp3. It is important to note that I need to control the sound in the main timeline without putting it in a MC. I have many things synced to the real mp3 I am using. I just want to be able to give the user volume control. I cannot thank you enough for this help.
    Attached Files Attached Files

  12. #12
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    if the sound is on the main timeline, then the sound volume cannot be controlled. in order for the sound volume to be controlled it has to be in an mc. it is possible to place the entire movie with the sound into a movieclip?
    If you don't think you're going to like the answer, then don't ask the question.

  13. #13
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    scratch the above post. i'll see what i can do with your fla
    If you don't think you're going to like the answer, then don't ask the question.

  14. #14
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    Quote Originally Posted by EQFlash
    scratch the above post. i'll see what i can do with your fla
    I could but the entire thing in an MC…

  15. #15
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here ya go. let me know if it's what you want.
    Attached Files Attached Files
    If you don't think you're going to like the answer, then don't ask the question.

  16. #16
    Junior Member
    Join Date
    Jul 2008
    Posts
    28
    Perfect! /bow
    Mind if i pick your brain for a mute button?
    If you can't that's cool. You have been VERY helpful.
    Thank you.

    edit: What bit of code would i change to start the slider 3/4 of the way up instead of all the way?
    Last edited by Sisyphus; 08-05-2008 at 10:08 AM.

  17. #17
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here's the update version, with the mute text button and slider repositioned to 3/4.
    Attached Files Attached Files
    Last edited by EQFlash; 08-05-2008 at 05:03 PM.
    If you don't think you're going to like the answer, then don't ask the question.

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