A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Simple (Sound on - Sound off)

  1. #1
    Ok, how do i make a button that when you click, it turns off the music that is playing and when you click it again it turns on the music.

    I looked at flash guru's example and he has two buttons...i just want one.

    I got it so that is turns ON the music but how do i use the same button to turn it off?

    on (release) {
    if (not(playing)) {
    sound.volumechanger.start( starter,loops );
    playing = true;
    }
    }

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    on(release){
    if(playing){
    sound.volumechanger.stop;
    playing=false;
    Else{
    sound.volumechanger.start(starter,loops);
    playing=true
    }
    }

    Hope that helps!
    Regards FlashGuru

    p.s that would be a worthy addition to the sound source file!
    Thanks steve

  3. #3
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    on(release){
    if(playing){
    sound.volumechanger.stop;
    playing=false;
    Else{
    sound.volumechanger.start(starter,loops);
    playing=true;
    }
    }

    Hope that helps!
    Regards FlashGuru

    p.s that would be a worthy addition to the sound source file!
    Thanks steve

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